Skip to content

Conversation

@klausi
Copy link

@klausi klausi commented Jan 9, 2026

Sister doc PR for PHPCSStandards/PHP_CodeSniffer#1356

PR checklist

  • I have checked there is no other PR open for the same change.
  • I have read the Contribution Guidelines.
  • I grant the project the right to include my changes under the BSD-3-Clause license (and I have the right to grant these rights).
  • I have verified that my changes comply with the projects coding standards.

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

=== This is an auto-generated comment ===

Thank you for your PR.
A dry-run has been executed on your PR, executing all markdown pre-processing for the wiki files.

Please review the resulting final markdown files via the created artifact.
This is especially important when adding new pages or updating auto-generated output blocks.

N.B.: the above link will automatically be updated when this PR is updated.

Copy link
Member

@jrfnl jrfnl left a 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.

Comment on lines +1112 to +1123
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) {
}
```
Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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 ?

@klausi klausi requested a review from jrfnl January 25, 2026 16:43
@klausi
Copy link
Author

klausi commented Jan 25, 2026

Thank you as always for the clear guidance and patience, ready to check again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants