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 call to instance method
error should not happen if class implements __callStatic
method
#3641
Comments
Hi, this is some really crazy code. I'm reluctant to just I'd advise you to fix your code so that it doesn't rely on this hack, or just |
It's from Laravel 😅 This kind of pattern is popular in Laravel. Calling static methods on facades, and then facade forwards the call to the underlying instance via
It's not just about the I'm trying to add support to some facades in Larastan. And just creating a stub for the facade, and adding the correct |
Oh, I looked at the example more closely and realized I misread it earlier today. I thought the problem was that there’s both method “bar()” and “__callStatic” on Bar, that would be far more problematic. The current code example can probably be solved. I’d just prefer if there was a different a different annotation like |
Fixed: phpstan/phpstan-src@aa38695 Please test the dev-master of phpstan/phpstan in 15 minutes to verify that this works in Laravel :) Thanks! |
Yes, it works now! Thank you! |
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. |
Feature request
For the given code:
https://phpstan.org/r/856294ef-b9e3-4d5f-94d9-2dcae85f72cb
I'd expect no errors. (https://3v4l.org/MRhFu)
The text was updated successfully, but these errors were encountered: