You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since phpstan 1.6 it is possible to use conditional return statements, phpstorm supports parsing this type of phpdoc since 2022.3.1 but it seems that the inspection provided by this plugin does not and returns some false positives in the inspection results.
As seen in the screenshots, if the parameter $required is set to true the function will return a non nullable value so the null pointer exception will not happen later:
Not sure that this change is possible/easy to do but it would be great if someone can have a look at it and see if it is possible to handle this case. (Currently I add a phpdoc comment to silence this inspection but it does not seem to be ideal)
The text was updated successfully, but these errors were encountered:
Since phpstan 1.6 it is possible to use conditional return statements, phpstorm supports parsing this type of phpdoc since 2022.3.1 but it seems that the inspection provided by this plugin does not and returns some false positives in the inspection results.
As seen in the screenshots, if the parameter
$required
is set totrue
the function will return a non nullable value so the null pointer exception will not happen later:Not sure that this change is possible/easy to do but it would be great if someone can have a look at it and see if it is possible to handle this case. (Currently I add a phpdoc comment to silence this inspection but it does not seem to be ideal)
The text was updated successfully, but these errors were encountered: