You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After some investigation i can summarize it to below facts.
Given my vendor directory, fulfilled from composer, has two packages with the same namespace, but different directories in which the code lies by using PSR-4.
e.g.
zendframework/zend-expressive-router
zendframework/zend-expressive-fastroute
And i use composers autoloader and he reckons to uses first the fastroute package and router afterwards. (Was the case in the linked issue)
PHP Fatal error: Uncaught Roave\BetterReflection\Reflector\Exception\IdentifierNotFound: Roave\BetterReflection\Reflection\ReflectionClass "Zend\Expressive\Router\RouterInterface" could not be found in the located source
The method attemptAutoloadForIdentifier returns this file path:
But not if the router is the first value in that array.
Perhaps this is an issue from composer, but since the nativ reflection from php under same circumstances works like a charm, I would drop it here. sorry ;)
$reflection = new \ReflectionClass(\Zend\Expressive\Router\RouterInterface::class);
echo$reflection->getFileName(); #vendor/zendframework/zend-expressive-router/src/RouterInterface.php
Thanks!
The text was updated successfully, but these errors were encountered:
Hi!
In another library using this package an issue appeared which arises from here.
prooph/message-flow-analyzer#2
After some investigation i can summarize it to below facts.
Given my vendor directory, fulfilled from composer, has two packages with the same namespace, but different directories in which the code lies by using PSR-4.
e.g.
And i use composers autoloader and he reckons to uses first the fastroute package and router afterwards. (Was the case in the linked issue)
Than this call
would raise this exception:
The method
attemptAutoloadForIdentifier
returns this file path:which is properly wrong and should be:
This only happens if the
$prefixDirsPsr4
array fromvendor/composer/autoload_static.php
contains a like this:But not if the router is the first value in that array.
Perhaps this is an issue from composer, but since the nativ reflection from php under same circumstances works like a charm, I would drop it here. sorry ;)
Thanks!
The text was updated successfully, but these errors were encountered: