Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh left a comment
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
derrabus left a comment
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
wouterj commentedSep 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
As far as I know, we do not accept static analysis annotations that are not generally supported across Psalm, PHPStan and PhpStorm (see also thelist of accepted annotations in the Symfony standards). It seems like |
stof commentedSep 13, 2024
Psalm does support the phpstan has a different default than psalm regarding this option. |
wouterj commentedSep 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ah, of course. Thanks for correcting me,@stof. Let's do it then 👍 , but with the |
stof commentedSep 13, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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). |
stof commentedSep 13, 2024
For reference, seehttps://psalm.dev/docs/annotating_code/adding_assertions/#asserting-return-values-of-methods for the Psalm documentation about the exact conditions for |
Uh oh!
There was an error while loading.Please reload this page.
…sponse has been called
nicolas-grekas commentedOct 9, 2024
Thank you@shyim. |
52f1436 intosymfony:7.2Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
PHPStan understands now inside the if that Response is not nullable anymore