-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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.ScopeIndent.Incorrect issue after NOWDOC #2883
Comments
Could you check what happends when the |
Good find, if the trailing comma after the NOWDOC closing tag is moved to the next line the issue goes away. That's ugly though 😛 |
…r NOWDOC Stopping at the end of a here/nowdoc when finding the start of a statement isn't correct. These token have openers/closers to help sniff developers, but they are still strings and should be skipped over in the same way.
…r NOWDOC Stopping at the end of a here/nowdoc when finding the start of a statement isn't correct. These token have openers/closers to help sniff developers, but they are still strings and should be skipped over in the same way.
I've committed a fix for this problem. The core issue is the the end of the nowdoc was seen as the end of that statement, whereas the comma should really be the end. The whitespace sniff specifically tries to ignore commas to cover cases like this, but the nowdoc issue was stopping that from working. Thanks for the report. |
Hi there,
I'm having an issue where phpcs is complaining about my indentation level in a nested array.
It seems to be caused by a NOWDOC or HEREDOC and then the issue crops up somewhere after a multi-line array
This is using phpcs version 3.5.4
The following array reproduces this issue:
The full error is:
If I were to attempt to fix this with phpcbf it adds the indentation and throws the next error:
Any further attempts to fix this just go back and forth between the two.
If you need any further details please let me know!
The text was updated successfully, but these errors were encountered: