Commit df21713
committed
Squiz/FunctionDeclarationArgumentSpacing: exclude space from prepareForOutput()
The `SpacingAfterHint` error uses `Common::prepareForOutput()` to make
whitespace characters visible in the error message when the gap between
a type hint and argument contains tabs or newlines. Among other things,
the method replaces spaces with a UTF-8 middot character.
This commit changes the call to `Common::prepareForOutput()`, to pass
`[' ']` as the `$exclude` parameter so that spaces are displayed as-is
while tabs and newlines continue to be rendered as `\t` and `\n`. This
change is necessary because the middot character in the output can break
tools that pipe PHPCS output through non-UTF-8 environments (see
squizlabs/PHP_CodeSniffer 2652).
`Common::prepareForOutput()` was added to this sniff in PR 620.1 parent 9fdbd6e commit df21713
File tree
1 file changed
+1
-1
lines changed- src/Standards/Squiz/Sniffs/Functions
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
0 commit comments