phpDocumentor/Reflection

define() in global namespace generates invalid fqsen

othercorey opened this issue · 0 comments

If you create a define in the global namespace, the fqsen generated is \\NAME which fails the regex expression in Fqsen constructor.

define('SECOND', 1);

PHP Fatal error: Uncaught InvalidArgumentException: "\\SECOND" is not a valid Fqsen. in /cake/api/vendor/phpdocumentor/reflection-common/src/Fqsen.php:51
Stack trace:
#0 /cake/api/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/Php/Factory/Define.php(118): phpDocumentor\Reflection\Fqsen->__construct('\\\\SECOND')
#1 /cake/api/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/Php/Factory/Define.php(96): phpDocumentor\Reflection\Php\Factory\Define->determineFqsen(NULL, Object(PhpParser\Node\Arg))