We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Booleans in condition report explicitMixed in level 7 https://phpstan.org/r/954e86c5-1a77-43e9-a4c7-c96f9c66b1fe
But doesn't report implicitMixed in level 10 https://phpstan.org/r/865a7467-a5f4-46c3-a95f-b592db7e2f9e
This is because BooleanRuleHelper has a custom behavior for mixed
phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanRuleHelper.php
Lines 25 to 27 in a4a6a08
I think it should rely on explicitMixed/implicitMixed config instead.
Option 1: Chaning nothing
Option2: Using both checkExplicitMixed/checkImplicitMixed config
if ($type instanceof MixedType) { if ($type->isExplicitMixed()) { return !$this->checkExplicitMixed; } else { return !$this->checkImplicitMixed; } }
Option3: Keeping the behavior for explicitMixed but allow to report implicitMixed.
if ($type instanceof MixedType) { return !$type->isExplicitMixed() && !$this->checkImplicitMixed; }
I would go with option 2, but it's your call @ondrejmirtes
The text was updated successfully, but these errors were encountered:
Option 3 makes most sense to me. Doesn't change anything until level 9, but will report implicit mixed on level 10.
Sorry, something went wrong.
No branches or pull requests
Booleans in condition report explicitMixed in level 7
https://phpstan.org/r/954e86c5-1a77-43e9-a4c7-c96f9c66b1fe
But doesn't report implicitMixed in level 10
https://phpstan.org/r/865a7467-a5f4-46c3-a95f-b592db7e2f9e
This is because BooleanRuleHelper has a custom behavior for mixed
phpstan-strict-rules/src/Rules/BooleansInConditions/BooleanRuleHelper.php
Lines 25 to 27 in a4a6a08
I think it should rely on explicitMixed/implicitMixed config instead.
Option 1:
Chaning nothing
Option2:
Using both checkExplicitMixed/checkImplicitMixed config
Option3:
Keeping the behavior for explicitMixed but allow to report implicitMixed.
I would go with option 2, but it's your call @ondrejmirtes
The text was updated successfully, but these errors were encountered: