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
@@ -4,8 +4,8 @@
}
function run(bool $param): bool
{
- if (!test($param)) {+ if (test($param) === 0 || test($param) === false) {
return true;
}
return false;
}
Expected Behavior
I see couple ways:
adding variable (yes, naming is hard)
skip or add a warning (if it is possible)
I'm not sure which way is better, but changing code to calling function more than one time (for this case) may lead to bugs, because we never know if the function have any side-effects or not.
The text was updated successfully, but these errors were encountered:
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/6c9e6aa3-5582-4c51-ad40-d9e27c5303a0
Responsible rules
BooleanInBooleanNotRuleFixerRector
BTW custom function creates a bit different diff
See https://getrector.com/demo/6c9e6aa3-5582-4c51-ad40-d9e27c5303a0
Expected Behavior
I see couple ways:
I'm not sure which way is better, but changing code to calling function more than one time (for this case) may lead to bugs, because we never know if the function have any side-effects or not.
The text was updated successfully, but these errors were encountered: