New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reflection error
on class_alias
object definition after upgraded from 0.12.4 to 0.12.9
#2958
Comments
Type aliases will not help you here, that's not what they are meant for. Can you please post some minimal code using |
Yep I can create such code. Do you want that I make a PR somewhere or I just add the code here in a comment ? |
Just here, and as minimal as possible. I think something very close to |
I think I fixed it, please try the latest dev-master of phpstan/phpstan (phpstan/phpstan-src@c0cb3a6, 0749384). Thank you. |
It's possible you'll have to add a line like this to your PHPStan's bootstrap (https://github.com/phpstan/phpstan#bootstrap-file - see README): class_exists(\Hoa\Stream::class); All of this is just because Hoa's aliases aren't friendly to static analysis, I reported this a few days ago: hoaproject/Consistency#34 |
Hello ! It seems to work on the Thank you for your help 😉. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Support question
Hello,
I'm using the hoa/websocket package which rely to
class_alias
to simplify some class names...For example the class
Hoa\Socket\Connection\Connection
is aliased toHoa\Socket\Connection
.You can check the definition here: https://github.com/hoaproject/Socket/blob/master/Source/Connection/Connection.php#L813
After updating to phpstan 0.12.9, I got an error :
Before the update, the analysis hasn't any trouble with the
@param
and@var
aliased class names.I saw that there is a new
typeAliases
in the configuration but it doesn't seems to fix my issue. Here is my localphpstan.neon
configuration :Do you know how to understand this issue and fix it ?
The text was updated successfully, but these errors were encountered: