From 57bc56c6d1af4f117ecb36e74e530d6b627433b2 Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Mon, 5 Nov 2018 13:35:15 +0100 Subject: [PATCH] Created Structures (markdown) --- Structures.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Structures.md 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