-
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
Squiz.PHP.NonExecutableCode.Unreachable when using ternary operator #2857
Comments
This is absolutely a bug, but I've been trying to decide if I remove all these non-code-style sniffs in version 4 instead of trying to support them. It's not what PHPCS is good at and not a collection of sniffs I have time to keep updated. I'll leave this open as a bug until I decide either way, but no work will be done on it until I do. |
Overall, these work really good and there's few bugs in those, so I think it would be great if they could be kept, as they are really useful. |
the same for null coalescing operation + throw (php 8): $referrer = $invitedUser->referrer ?? throw new \DomainException('Should not be reached!');
if ($referrer->email) {
...
}
|
Affects external issue https://www.drupal.org/project/date_recur/issues/3250423 |
FYI: the fix for this issue is included in today's PHP_CodeSniffer 3.8.0 release. As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo). |
Getting Squiz.PHP.NonExecutableCode.Unreachable for following (valid) code:
The text was updated successfully, but these errors were encountered: