-
-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
Describe the bug
The error message is unclear when a switch case begins with : and {:
CASE statements must be defined using a colon (PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase)
Code sample
switch ($type) {
case 'bool':
{
break;
}
}Expected behavior
Expect the error message to explain the case cannot include bracket scope after the colon not just that it needs a colon.
Versions (please complete the following information)
| PHP version | 8.3 |
| PHP_CodeSniffer version | 4.0.1 |
| Standard | PSR2 |
| Install type | composer |
Additional context
Add any other context about the problem here.
Please confirm
- I have searched the issue list and am not opening a duplicate issue.
- I have read the Contribution Guidelines and this is not a support question.
- I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
- I have verified the issue still exists in the
4.xbranch of PHP_CodeSniffer.