-
Notifications
You must be signed in to change notification settings - Fork 548
Modify the built-in @method extension to look at @throws in __call
#1842
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
Conversation
| $classReflection->hasNativeMethod('__call') | ||
| ? $classReflection->getNativeMethod('__call')->getThrowType() | ||
| : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For static methods this should look at __callStatic instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
87d6b3f to
5893ba6
Compare
build/phpstan.neon
Outdated
| - 'PHPStan\Analyser\UndefinedVariableException' | ||
| - 'RuntimeException' | ||
| - 'Nette\Neon\Exception' | ||
| - 'Nette\MemberAccessException' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no longer be necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, done
| private array $parameters, | ||
| private bool $isStatic, | ||
| private bool $isVariadic, | ||
| private ?Type $throwType = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not need to be optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know if i needed to be BC. Changed.
| ); | ||
| } | ||
|
|
||
| $isStatic = $methodTags[$methodName]->isStatic(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're extracting this into a variable, you should use this variable on line 70.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot indeed, done
@method extension to look at @throws in __call
|
Thank you. |
Closes phpstan/phpstan#8163