-
-
Notifications
You must be signed in to change notification settings - Fork 864
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
Static method should return static(X) but returns X. #4648
Comments
Right now you can use |
@ondrejmirtes That was quick :D |
That would be an option, if I would not have simplified that bit for the report. I'm actually doing something like |
Can you write a more specific example to your situation? Also, are you aware of the stub files aimed at overriding wrong 3rd party PHPDocs? https://phpstan.org/user-guide/stub-files |
I added the https://phpstan.org/r/adf566da-efb5-46da-93d2-d13d368934ac I was not aware of the stub files, I'll have to check it out. Thanks for the tip! For now, I simply ignored the error, and phpstan will eventually tell me that that ignored error is not happening anymore 😄 |
This is how the code should look: https://phpstan.org/r/73ab08ff-bda4-4a66-b20c-ef7fadacacd9 You can do that with stub files. |
Nice!!! Thanks, again 🥇 |
@MetalArend After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-18: Method ClassImplementation::convert() should return static(ClassImplementation) but returns ClassImplementation.
+No errors |
@MetalArend After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-20: Method ClassImplementation::convert() should return static(ClassImplementation) but returns ClassImplementation.
+No errors |
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. |
Bug report
I saw issue #2885, and updated to the latest version 0.12.80. But the issue remained.
Code snippet that reproduces the problem
https://phpstan.org/r/c64505e0-5173-424a-a5da-1f8ca503997a
Expected output
The output is
Method ClassImplementation::convert() should return static(ClassImplementation) but returns ClassImplementation.
. Afaik the implementation should be completely acceptable. It looks a lot like issue #2885, maybe it has something to do with the method being?The text was updated successfully, but these errors were encountered: