Skip to content

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

Merged
gsherwood merged 1 commit intosquizlabs:masterfrom
jrfnl:feature/generic-disallowtabindent-bugfix-php73-flexible-heredoc-nowdoc
Oct 21, 2022
Merged

Generic.WhiteSpace.DisallowTabIndent not reporting errors for PHP 7.3 flexible heredoc/nowdoc syntax#3640
gsherwood merged 1 commit intosquizlabs:masterfrom
jrfnl:feature/generic-disallowtabindent-bugfix-php73-flexible-heredoc-nowdoc

Conversation

@jrfnl
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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