mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-02 14:47:35 +02:00
Updated if Statement (markdown)
@@ -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.
|
||||
|
||||
<details><summary>Example</summary><div><br>
|
||||
|
||||
@@ -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.
|
||||
|
||||
<details><summary>Example</summary><div><br>
|
||||
|
||||
|
Reference in New Issue
Block a user