-
Notifications
You must be signed in to change notification settings - Fork 481
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
UselessFunctionReturnValueRule: More precise error message #3266
Conversation
This pull request has been marked as ready for review. |
|
I am not sure. this might mean we should drop these 2 from the rule |
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.
Yes, highlight_file and show_source should be dropped from this rule. It's more complicated with them.
Instead, these functions could have a stub file with a conditional return type.
Then, someone is free to write a rule that disallows bool
and potentially other types to be used in a string context, like concat and others. (But it's a bad fit for PHPStan core because it's not a bug.)
done
we already have these stubs |
Thank you. |
closes phpstan/phpstan#11377