You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 else is both the closing point for the if and the opening point for itself.
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
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: