Pattern: Constant if
statement
Issue: -
If statements that are always evaluated should be simplified or avoided altogether.
Example of incorrect code:
if (true) {
$var = 1;
}
Example of correct code:
if ($test) {
$var = 1;
}
Pattern: Constant if
statement
Issue: -
If statements that are always evaluated should be simplified or avoided altogether.
Example of incorrect code:
if (true) {
$var = 1;
}
Example of correct code:
if ($test) {
$var = 1;
}