Apply a rule like MatchExpressionNode to a method which accepts a condition as argument #10762
-
Related: mglaman/phpstan-drupal#734 Drupal has an I started exploring |
Beta Was this translation helpful? Give feedback.
Answered by
ondrejmirtes
Mar 21, 2024
Replies: 1 comment 3 replies
-
Please show a piece of code and expected result. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So basically you want to make sure that the method is not called with something PHPStan already knows is truthy/falsy?
You can write a rule for
StaticCall
and check the first argument type: