-
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
Squiz.ControlStructures.ControlSignature does not handle alt syntax when checking space after closing brace #1387
Labels
Comments
This looks like a bug in the sniff to me. The core tokenizer has processed this code structure correctly, but the sniff is confused by the fact that |
gsherwood
changed the title
Expected 1 space after closing brace; newline found
Squiz.ControlStructures.ControlSignature does not handle alt syntax when checking space after closing brace
Mar 13, 2017
gsherwood
added a commit
that referenced
this issue
Mar 13, 2017
…andle alt syntax when checking space after closing brace
This has been fixed now. There wont be any errors reported for that code when using PSR2. Thanks for reporting this. |
wow! impressive @gsherwood, thank you so much for your fast fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for your work! I have a question, which I think is a bug:
closing a brace inside a another if that uses the alternative syntax:
Error:
using this code, i found that phpcs fails on the line 8
}
. It shouldn't consider the next line as the continuation of the inner control structure.adding a new line between
}
andelse :
removes the error message:I inherit the code, so I just replaced the syntax. But on other occasions, should I follow the advice on #347 and use custom ruleset or is this a bug?
this is a gist with both blocks. It fails on the first and passes the second:
https://gist.github.com/LC43/383ff51e169b9b113cdb750dbcdcf25b
thank you.
The text was updated successfully, but these errors were encountered: