2 Structures
LogMANOriginal edited this page 2018-11-05 13:56:36 +01:00

Structures must always be formatted as multi-line blocks

A structure should always be treated as if it contains a multi-line block.

Add a space after closing parenthesis

Example

Bad

if($condition){
    ...
}

Good

if($condition) {
    ...
}

Add body into new line

Example

Bad

if($condition){ ... }

Good

if($condition) {
    ...
}

Close body in new line

Example

Bad

if($condition){
    ... }

Good

if($condition) {
    ...
}

Reference: Squiz.ControlStructures.ControlSignature