-
Notifications
You must be signed in to change notification settings - Fork 26
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
Operator spacing union types / multi-catch expressions #67
Comments
See #45 We have some issues around consistency that won't be resolved before v2.0.0 in |
Thanks for that link, I'll read up on the discussion.
For context: I'm not asking for me/my own code. I'm asking as a maintainer of/contributor to various PHPCS standards (i.e. as someone having to field support questions about this). |
nonver2. 0_1.0 |
I believe some clarification is needed about the spacing requirements around the
|
operator when used in the following two situations:At this moment, most coding standards I'm aware of use "no spaces around the
|
operator" as a rule for union types.However, multi-catch statements predate union types and the example in section 5.6 had spaces around the
|
operator.PHPCS has taken the literal interpretation based on the example and expects one space on either side of the
|
operator in multi-catch statements.CS-Fixer treats the
|
in multi-catch as if it were a union type, expecting no spaces.End-users are confused ;-/
Ref: squizlabs/PHP_CodeSniffer#3663
The text was updated successfully, but these errors were encountered: