-
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
PSR2.Methods.FunctionCallSignature.Indent forces exact indent of ternary operator parameters #698
Comments
Probably an error, but I'm not aware of any ternary operator formatting sniffs out there. Since we're talking about code style I don't recommend putting complex constructs right inside method/function calls in general. |
@aik099 Writing code in this code style is often very convenient. i think it is bug in this rule |
…ct indent of ternary operator parameters
The sniff had various param types hard-coded so it could relax the indent for them. I've changed this to now relax the indent for all multi-line params, including ternary operators. Thanks for reporting the bug. |
It seems this may have introduced a regression since 2.3.4. See WordPress/WordPress-Coding-Standards#525 |
…se it) now correctly check the first argument (ref bug #698)
@westonruter I think I found the problem. I replicated with the PEAR coding standard and checked the fix against the WordPress one as well. All seems to be working now. Thanks for reporting this. |
❤️ ❗ |
I keep hitting a violation for PSR2.Methods.FunctionCallSignature.Indent with code like the following:
phpcbf wants to fix it as
I'm generally trying to stick to PSR-2 style rules, but I don't like the way the auto-fix tries to put that all at the same indent level
The text was updated successfully, but these errors were encountered: