-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Generic.WhiteSpace.ScopeIndent issues with inline HTML and multi-line function signatures #1188
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
Labels
Comments
Debug output:
|
gsherwood
added a commit
that referenced
this issue
Oct 20, 2016
…TML and multi-line function signatures
The problem was caused by the fix for #1101, but I've changed that fix and supported this code as well now. Thanks for reporting the bug and providing a great test case. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimum reproducible code:
It doesn't relate directly to class scope, but it only appears when the two functions are indented at least one level themselves (as when in a class, and
if
statement, or another function). Changing the upper function to not contain inline HTML will make the errors go away. Changing the lower function so that it does not have a multi-line declaration will make the errors go away.No errors are produced when these two elements are not used together in this order.
When the inline HTML is intended further (within several conditions, loops, etc.), the errors will likewise request for greater indents to match.
Tested against PHPCS 01ee360, the latest commit in
master
as of this writing. The issue also exists in 2.7.0 but not in 2.6.2. I've traced it to 07839d2.I am using tab indents and a custom ruleset, but I have also tested this by running:
And the errors are still reporting requiring those same two lines to be indented an extra space (not a full tab, or 4 spaces, but just one space).
Because this behavior is inconsistent (moving the lower method above the upper one will cause all errors to go away) I believe this is a bug.
The text was updated successfully, but these errors were encountered: