Commit ade8bc8
committed
Generic/ArrayIndent: remove T_COMMA from list of tokens to ignore
This commit removes T_COMMA from a list of tokens to ignore when
searching for the non-empty token before the start of the array. T_COMMA
was added to this list in 1697fac to fix a bug. See
squizlabs/PHP_CodeSniffer#3100 for more
details.
Back when this fix was introduced, it was necessary to ignore commas due
to a bug in findStartOfStatement() that would cause this method to
return the wrong token when passed the last token in a statement. This
bug has been fixed afterwards in ef80e53 and ignoring commas is not
necessary anymore. Now, the call to findStartOfStatement() in
https://github.com/squizlabs/PHP_CodeSniffer/blob/4cf6badaf0c177acaf295e2178f4383e2ea71b20/src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php#L67
correctly finds the start of the statement when passed the comma that
marks the end of the statement.
A test was added 1697fac. It would fail if running an older version of
PHPCS without ignoring commas, but now it passes:
https://github.com/squizlabs/PHP_CodeSniffer/pull/3101/files#diff-f786a9f6c41b82204dc89de2c02437c0e44401d580b02fcbde6278ea03f25693R83-R901 parent 4fd52f7 commit ade8bc8
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
0 commit comments