
logical_operators
¶Use &&
and ||
logical operators instead of and
and or
.
Risky, because you must double-check if using and/or with lower precedence was intentional.
--- Original
+++ New
<?php
-if ($a == "foo" and ($b == "bar" or $c == "baz")) {
+if ($a == "foo" && ($b == "bar" || $c == "baz")) {
}
The rule is part of the following rule sets:
Using the @PhpCsFixer:risky rule set will enable the logical_operators
rule.
Using the @Symfony:risky rule set will enable the logical_operators
rule.