Commit 93b7e2d
committed
Squiz/FunctionDeclarationArgumentSpacing: bug fix / unclear
When there would be a new line between the end of the previous parameter and the comma, the error message was not always descriptive enough.
For example, for the test added in this commit, the messages would be:
```
182 | ERROR | [x] Expected 0 spaces between argument "$paramA" and comma; 0 found
| | (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeComma)
185 | ERROR | [x] Expected 0 spaces between argument "$paramB" and comma; 4 found
| | (Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeComma)
```
In particular, take not of the "Expected 0 spaces... 0 found".
This commit improves the messaging to take new lines into account.
Includes tests.SpaceBeforeComma message1 parent 40a0f6b commit 93b7e2d
File tree
4 files changed
+28
-2
lines changed- src/Standards/Squiz
- Sniffs/Functions
- Tests/Functions
4 files changed
+28
-2
lines changedLines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
319 | | - | |
| 328 | + | |
320 | 329 | | |
321 | 330 | | |
322 | 331 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
0 commit comments