nikic/PHP-Parser — pull request #95 by llaville (2014-02-12 17:18:57+00:00)
Title: Add name attribute on magic constants

Here is a little contribution to add automatic name on magic constant nodes.

With unit tests
PHPUnit 3.7.31 by Sebastian Bergmann.

.......

Time: 187 ms, Memory: 2.00Mb

OK (7 tests, 7 assertions)

Here is a sample of result in real condition

[args] => Array
(
[0] => PhpParser\Node\Arg Object
(
[subNodes:protected] => Array
(
[value] => PhpParser\Node\Scalar\MagicConst\File Object
(
[subNodes:protected] => Array
(
[name] => PhpParser\Node\Name Object
(
[subNodes:protected] => Array
(
[parts] => Array
(
[0] => __FILE__
)

)

[attributes:protected] => Array
(
)

)

)

[attributes:protected] => Array
(
[startLine] => 185
[endLine] => 185
)

)

[byRef] =>
)

[attributes:protected] => Array
(
[startLine] => 185
[endLine] => 185
)

)

)

BTW, thanks for your parser, its really a pleasure to implement it. I did it only on one day to replace my old parser in my PHP Reflect v2 project.