-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat(PSR12.Operators.OperatorSpacing): Add documentation for perCompatible setting #86
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
base: main
Are you sure you want to change the base?
Conversation
|
=== This is an auto-generated comment === Thank you for your PR. Please review the resulting final markdown files via the created artifact. N.B.: the above link will automatically be updated when this PR is updated. |
jrfnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this PR @klausi!
I've left some inline notes.
| Valid: no spaces around the '|' operator in a multi-catch with 'perCompatible=3.0' (or higher): | ||
| ```php | ||
| try { | ||
| } catch (Exception|RuntimeException $e) { | ||
| } | ||
| ``` | ||
| Invalid: spaces around the '|' operator in a multi-catch with 'perCompatible=3.0' (or higher). | ||
| ```php | ||
| try { | ||
| } catch (Exception | RuntimeException $e) { | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no precedent in this document for repeating the valid/invalid code samples from the XML docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the wording without examples is hard to understand, keeping these examples would improve the docs here to understand what multi-catch even means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point. Maybe this section could be rephrased in a way that it doesn't duplicate the XML docs ?
Maybe one code sample with two catch blocks and inline documentation about the change in PER instead of the Valid/Invalid phrases ?
Co-authored-by: Juliette <[email protected]>
|
Thank you as always for the clear guidance and patience, ready to check again! |
Sister doc PR for PHPCSStandards/PHP_CodeSniffer#1356
PR checklist