diff --git a/Structures.md b/Structures.md new file mode 100644 index 0000000..a99fa2e --- /dev/null +++ b/Structures.md @@ -0,0 +1,68 @@ +# Structures + +Structures must follow a few rules. + +**Add a space after closing parenthesis** + +
Example

+ +**Bad** + +```PHP +if($condition){ + ... +} +``` + +**Good** + +```PHP +if($condition) { + ... +} +``` + +

+ +**Add body into new line** + +
Example

+ +**Bad** + +```PHP +if($condition){ ... } +``` + +**Good** + +```PHP +if($condition) { + ... +} +``` + +

+ +**Close body in new line** + +
Example

+ +**Bad** + +```PHP +if($condition){ + ... } +``` + +**Good** + +```PHP +if($condition) { + ... +} +``` + +

+ +_Reference_: [`Squiz.ControlStructures.ControlSignature`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php) \ No newline at end of file