Commit 1643fb6
committed
Squiz/IncrementDecrementUsage: bug fix - comments in value being assigned
As this is a sniff looking for certain functional code patterns, the sniff should disregard whitespace and comments when looking for the relevant tokens to determine whether the code under scan contains the code pattern the sniff is looking for.
The sniff, however, does not do this correctly (in multiple places).
This commit fixes one more of these issues.
In this case, if there was a comment anywhere in the value being assigned, the sniff would incorrectly disregard the assignment as one which should be examined.
Fixed now.
Includes tests.1 parent b0c442a commit 1643fb6
File tree
3 files changed
+13
-2
lines changed- src/Standards/Squiz
- Sniffs/Operators
- Tests/Operators
3 files changed
+13
-2
lines changedLines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
0 commit comments