Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic/DisallowSpaceIndent: flag heredoc/nowdoc closer using tab indent
This is the same fix for the `Generic.WhiteSpace.DisallowSpaceIndent` sniff as was previously made in squizlabs/PHP_CodeSniffer 3640 and 533 for the sister-sniff `Generic.WhiteSpace.DisallowTabIndent`. --- 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 were not included in the tokens to look at for the `Generic.WhiteSpace.DisallowSpaceIndent` sniff, which could lead to false negatives. Fixed now, includes tests. And along the same lines as per 533: * The error for space indentation of heredoc/nowdoc closers is not auto-fixable to prevent the fixer creating parse errors as the indentation of the _contents_ of the heredoc/nowdoc has to be the same as for the closer. * The error for space indentation of heredoc/nowdoc closers has its own error code to allow for selectively ignoring the indentation of heredoc/nowdoc closers.
- Loading branch information