-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] allow narrow type of not nullable getResponse when hasResponse has been called #58241
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
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.
but for 7.2 as this is not a bugfix
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 7.2
As far as I know, we do not accept static analysis annotations that are not generally supported across Psalm, PHPStan and PhpStorm (see also the list of accepted annotations in the Symfony standards). It seems like |
Psalm does support the phpstan has a different default than psalm regarding this option. |
Ah, of course. Thanks for correcting me, @stof. Let's do it then 👍 , but with the |
The only change in behavior is for the case where you write something wrong in the tag: both phpstan and psalm are reporting errors when writing an invalid tag with their own prefix while they silently discard an invalid tag using the prefix of the other tool (because maybe this tag is actually valid in the other tool and they don't have feature parity). |
For reference, see https://psalm.dev/docs/annotating_code/adding_assertions/#asserting-return-values-of-methods for the Psalm documentation about the exact conditions for |
…sponse has been called
b09edea
to
69f2f48
Compare
Thank you @shyim. |
PHPStan understands now inside the if that Response is not nullable anymore