Commit abab1cb
committed
OperatorSpacing: check spacing around
PHPCS 3.3.0 introduces a `PSR12.Operators.OperatorSpacing` sniff.
I've investigated whether that sniff would be a better sniff to extend for the `WordPress.WhiteSpace.OperatorSpacing` sniff than the `Squiz.WhiteSpace.OperatorSpacing` sniff which is currently being extended and have concluded that it is not for the following reason:
* The PSR12 sniff demands _at least_ one space instead of _exactly_ one space (both allow for new lines with the correct properties).
All the same, the `PSR12` sniff did include an additional token - `T_INSTANCEOF` - which makes sense to add to the WPCS sniff.
Includes unit tests.instanceof operator1 parent ab41be9 commit abab1cb
File tree
4 files changed
+10
-0
lines changed- WordPress
- Sniffs/WhiteSpace
- Tests/WhiteSpace
4 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
0 commit comments