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
This issue appeared in 0.12.86, and still exists in 0.12.87.
When instantiating a class from a string that contains the class name, PHPStan will error if the class name is fully qualified -- i.e., if it starts with a backslash.
class Foo {}
// works fine
$class = new Foo();
// works fine
$name = 'Foo';
$class = new $name();
// fails with "Instantiated class \Foo not found."
$name = '\Foo';
$class = new $name();
// fails with "Instantiated class \Foo not found."
$name = '\\Foo';
$class = new $name();
Hello there, we have a simillar issue to FQCN defined by strings in shopsys. Our issue is a bit different but I belive it is related (as @AlexHowansky we are experiencing it from version 0.12.86).
We have failing standards for creating mocks using FQCN with leading backslash, but there are only some of them reported.
Bug report
This issue appeared in 0.12.86, and still exists in 0.12.87.
When instantiating a class from a string that contains the class name, PHPStan will error if the class name is fully qualified -- i.e., if it starts with a backslash.
https://phpstan.org/r/fb04310a-7e86-45a4-bbdc-c306ccb91f09
Expected output
This is a false positive. No error should be reported.
The text was updated successfully, but these errors were encountered: