See https://docs.backdropcms.org/php-standards#control-structures
While the standard shows this:
if (condition1 || condition2) {
action1;
}
elseif (condition3 && condition4) {
action2;
}
else {
defaultaction;
}
Doing this is currently not flagged:
if(condition1 || condition2){
action1;
}elseif(condition3 && condition4){
action2;
}else{
defaultaction;
}
The standard says:
Control statements should have one space between the control keyword and opening parenthesis, to distinguish them from function calls.
But perhaps it also needs to explicitly state about the space between condition parentheses and the curly braces as shown in the example.
See https://docs.backdropcms.org/php-standards#control-structures
While the standard shows this:
Doing this is currently not flagged:
The standard says:
But perhaps it also needs to explicitly state about the space between condition parentheses and the curly braces as shown in the example.