Skip to content

ValueResolver confused by __DIR__ constant #9035

@jtojnar

Description

@jtojnar

Bug Report

Subject Details
Rector version 2.0.9

I am trying to upgrade a custom Rector rule from old version of Rector in j0k3r/graby#365 but in 2.0, it no longer appears to be able to handle __DIR__ constant.

Minimal PHP Code Causing Issue

https://getrector.com/demo/4c428282-bbc7-46b6-9db4-eab6d9e90f2f

Inserting var_dump (not allowed on the demo server) would show:

array(1) {
  ["bar"]=>
  NULL
}

Expected Behaviour

It should resolve the __DIR__ constant in the context of refactored file:

array(1) {
  ["bar"]=>
  array(1) {
    ["foo"]=> "/home/jtojnar/Projects/graby/tests/bar"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions