phpDocumentor/Reflection

Define statements that are expressions fail to parse

mvriel opened this issue · 0 comments

When you define a global constant as a define with the NAMESPACE magic constant (for example); this library will throw an error:

Notice: Undefined property: PhpParser\Node\Expr\BinaryOp\Concat::$value
strpos() expects parameter 1 to be string, null given

This is because this library assumes that the value of the Define node is always a string; while this is not necessarily true

Example case:

define(__NAMESPACE__ . '\\MY_CONSTANT', 123);