-
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
Disable exact checking of multi-line chained method calls in Generic.WhiteSpace.ScopeIndent #2371
Comments
… multi-line chained methods (ref squizlabs#2371)
Please have a look at PR #2224 which is making changes for that type of code as well. |
Awesome 👍 That's indeed why I made this PR. It will make sure that any custom indenting like proposed in that PR will work together with |
I confirm that this is fixing the issue in our code. Thanks @pfrenssen ! |
I'm preparing to adopt a coding standard that is based on PSR-2 and the upcoming PSR-12. The standard will require an exact indentation of 4 spaces. In the current implementation of the PSR-12 ruleset the exact checking of the
Generic.WhiteSpace.ScopeIndent
is disabled because this option is incompatible with some custom indentation rules. The documentation mentions that the option is not recommended to be used.However in my testing it appears that with the recent fix of [#2281] the exact indentations work pretty well when enabled in the PSR-12 ruleset:
In the projects I have tested the main problem that is occurring right now is that chained method calls split over multiple lines are falsely detected. An example:
I propose to skip exact checking of multi-line chained method calls.
This puts us one step closer to a strict 4-space indentation rule for PSR-12, and it will allow to use sniffs suchs as
PEAR.WhiteSpace.ObjectOperatorIndent
without conflicts.The text was updated successfully, but these errors were encountered: