Suggestion about usage of checkAlwaysTrueStrictComparison #11051
-
Hi, I've tried turning on this flag and it finds some things I wanted it to find. Something like
And I know that
Same example written here: https://phpstan.org/r/4de19a7a-7f51-4319-b757-fe7f7a63cb82 but I couldn't force it to give error since I didn't figure out how to turn on that flag in Playground. Do you have any suggestions on how I should approach this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You're probably using an old PHPStan version, that's why it doesn't show up in the playground. I agree that if you want to handle all enum cases, Also please note there are some changed if you enable Bleeding Edge:
|
Beta Was this translation helpful? Give feedback.
You're probably using an old PHPStan version, that's why it doesn't show up in the playground.
I agree that if you want to handle all enum cases,
default
is counterproductive. It's better to removedefault
and let PHPStan tell you you're missing a case: https://phpstan.org/r/8dc983c5-0f75-43fa-a051-c906e3f837feAlso please note there are some changed if you enable Bleeding Edge: