You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: WHITESPACE-ALIGNMENT.md
-25Lines changed: 0 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,5 @@
1
1
# Whitespace and Alignment
2
2
3
-
* Follow _PSR Recommendations_ by default.
4
-
5
-
*`switch` control statement:
6
-
* In addition to the standard whitespace for `switch` statements, the contents of each `case` or `default` block should be indented for readability. This includes the closing `break`.
7
-
* Also, there should always be a `default` block.
8
-
9
-
```php
10
-
switch ($value) {
11
-
case 'a':
12
-
// Some code...
13
-
break;
14
-
15
-
case 'b':
16
-
// Some code...
17
-
break;
18
-
19
-
default:
20
-
// Some code...
21
-
}
22
-
```
23
-
24
-
* Blocks of variable setting should have all `=` characters vertically-aligned.
25
-
26
-
* Associative arrays (e.g., hashes, dictionaries) should have all `=>` symbols vertically-aligned.
27
-
28
3
* You are encouraged to give increment/decrement operators (`++` and `--`) a line of their own (with the exception of `for` loops).
0 commit comments