From e52f894e09685613ceb164e77a4924ded1957d6c Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Mon, 5 Nov 2018 13:26:31 +0100 Subject: [PATCH] Updated if Statement (markdown) --- if-Statement.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/if-Statement.md b/if-Statement.md index 4488622..a4a9460 100644 --- a/if-Statement.md +++ b/if-Statement.md @@ -1,4 +1,6 @@ -Use `elseif` instead of `else if`. For sake of consistency `else if` is considered bad practice. +# Use `elseif` instead of `else if`. + +For sake of consistency `else if` is considered bad practice.
Example

@@ -26,7 +28,7 @@ if($conditionA) { _Reference_: [`PSR2.ControlStructures.ElseIfDeclaration`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php) -*** +# Do not write empty statements Empty statements are considered bad practice and must be avoided. @@ -54,9 +56,9 @@ if(!$condition) { _Reference_: [`Generic.CodeAnalysis.EmptyStatement`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php) -*** +# Do not write unconditional if-statements. -Do not write unconditional if-statements. If-statements without conditions are considered bad practice and must be avoided. +If-statements without conditions are considered bad practice and must be avoided.
Example