mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 15:47:32 +02:00
Created Structures (markdown)
68
Structures.md
Normal file
68
Structures.md
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
# Structures
|
||||||
|
|
||||||
|
Structures must follow a few rules.
|
||||||
|
|
||||||
|
**Add a space after closing parenthesis**
|
||||||
|
|
||||||
|
<details><summary>Example</summary><div><br>
|
||||||
|
|
||||||
|
**Bad**
|
||||||
|
|
||||||
|
```PHP
|
||||||
|
if($condition){
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Good**
|
||||||
|
|
||||||
|
```PHP
|
||||||
|
if($condition) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</div></details><br>
|
||||||
|
|
||||||
|
**Add body into new line**
|
||||||
|
|
||||||
|
<details><summary>Example</summary><div><br>
|
||||||
|
|
||||||
|
**Bad**
|
||||||
|
|
||||||
|
```PHP
|
||||||
|
if($condition){ ... }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Good**
|
||||||
|
|
||||||
|
```PHP
|
||||||
|
if($condition) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</div></details><br>
|
||||||
|
|
||||||
|
**Close body in new line**
|
||||||
|
|
||||||
|
<details><summary>Example</summary><div><br>
|
||||||
|
|
||||||
|
**Bad**
|
||||||
|
|
||||||
|
```PHP
|
||||||
|
if($condition){
|
||||||
|
... }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Good**
|
||||||
|
|
||||||
|
```PHP
|
||||||
|
if($condition) {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</div></details><br>
|
||||||
|
|
||||||
|
_Reference_: [`Squiz.ControlStructures.ControlSignature`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php)
|
Reference in New Issue
Block a user