-
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
PSR12.Operators.OperatorSpacing and PHP 8.0 union types #3151
Comments
As PR #3032 has been merged, this issue can be closed as fixed. |
Can confirm fixed |
Hello. This still throws an error in the "catch" section
ERROR | [x] Expected at least 1 space before "|"; 0 found
|
@fr0N73ND3r That's because those are not considered union types, but a multi-catch condition. May look the same, but it is technically something different. I'd suggest bringing this up with PSR PER to add explicit rules about this. Related to #3663 |
Describe the bug
When using the PSR-12 implementation that ships with PHP_CodeSniffer, I cannot use union types as described in RFCs and other official or semi-official documentation.
Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
PSR12.Operators.OperatorSpacing
errors (eitherNoSpaceBefore
orNoSpaceAfter
):Expected behavior
I would expect to be able to use PSR-12 operator spacing lints without it complaining about union type delimiters, as those to my understanding are not actually operators.
Versions (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: