Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jul 29, 2022

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.

…s/nowdocs

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 gsherwood added this to the 3.7.2 milestone Aug 14, 2022
@gsherwood gsherwood changed the title PHP 7.3 | Generic/DisallowTabIndent: add support for flexible heredocs/nowdocs Generic.WhiteSpace.DisallowTabIndent not reporting errors for PHP 7.3 flexible heredoc/nowdoc syntax Oct 21, 2022
gsherwood added a commit that referenced this pull request Oct 21, 2022
@gsherwood gsherwood merged commit 831ff34 into squizlabs:master Oct 21, 2022
@gsherwood
Copy link
Member

Thanks a lot for fixing this.

@jrfnl jrfnl deleted the feature/generic-disallowtabindent-bugfix-php73-flexible-heredoc-nowdoc branch October 21, 2022 05:46
@jrfnl
Copy link
Contributor Author

jrfnl commented Oct 21, 2022

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants