Commit 8009bbe
committed
WP/I18n: fix
The auto-fixer for the `SuperfluousDefaultTextDomain` warning attempts to remove a complete parameter, though it will bow out from auto-fixing when there is a comment in the tokens which would be removed.
This auto-fixer code and the code to determine whether an auto-fix is possible, now needs adjusting to allow for function calls with named parameters as otherwise the fixer could cause parse errors.
* The parameter label and the `:` also needs to be removed.
* If the named parameter is the first parameter, there will not be a preceding comma, but we will need to remove the comma behind it.
* The range of tokens which needs to be checked for comments to determine whether the error is auto-fixable needs to be expanded.
This commit makes those changes.
Includes additional unit tests to safeguard the fixes.SuperfluousDefaultTextDomain auto-fix code to allow for named params1 parent ffcfe6f commit 8009bbe
File tree
4 files changed
+52
-4
lines changed- WordPress
- Sniffs/WP
- Tests/WP
4 files changed
+52
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
582 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
583 | 603 | | |
584 | 604 | | |
585 | 605 | | |
| |||
590 | 610 | | |
591 | 611 | | |
592 | 612 | | |
593 | | - | |
594 | 613 | | |
595 | | - | |
| 614 | + | |
596 | 615 | | |
597 | 616 | | |
598 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
293 | 304 | | |
294 | 305 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
293 | 304 | | |
294 | 305 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
| |||
0 commit comments