Skip to content

Spaces around Control Structures do not appear to be checkedΒ #14

@yorkshire-pudding

Description

@yorkshire-pudding

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions