squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.67k stars 1.48k forks source link

Generic.WhiteSpace.DisallowTabIndent not reporting errors for PHP 7.3 flexible heredoc/nowdoc syntax #3640

Closed jrfnl closed 2 years ago

jrfnl commented 2 years ago

Since PHP 7.3, heredoc/nowdoc closers may be indented. This indent can use either tabs or spaces and the indent is included in the T_END_HEREDOC/T_END_NOWDOC token contents as received from the PHP native tokenizer.

However, these tokens where not included in the tokens to look at for the Generic.WhiteSpace.DisallowTabIndent sniff, which could lead to false negatives.

Fixed now, includes tests.

gsherwood commented 2 years ago

Thanks a lot for fixing this.

jrfnl commented 2 years ago

You're welcome.