You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on something else, I came across the Squiz.ControlStructures.SwitchDeclaration sniff, and saw the following issues:
The sniff contains a number of whitespace/blank line related errors which are not currently auto-fixable, while I believe they could/should be auto-fixable.
A number of the error messages do not use the $data parameter, but concatenate the error message together instead. This should be fixed. Also see: Review error message creation #1240
Generally speaking, the sniff could do with a review with regards to the token walking being done.
Fixer code should be reviewed to see if the fixer can handle all situations or could result in multiple loops. If the latter, the fixer code should be fixed.
Example - "'CASE keyword must be followed by a single space'", SpacingAfterCase error code. The fixer doesn't appear to take into account that the whitespace after the "case" keyword could be multiple new lines.
While working on something else, I came across the
Squiz.ControlStructures.SwitchDeclarationsniff, and saw the following issues:$dataparameter, but concatenate the error message together instead. This should be fixed. Also see: Review error message creation #1240Example - "'CASE keyword must be followed by a single space'",
SpacingAfterCaseerror code. The fixer doesn't appear to take into account that the whitespace after the "case" keyword could be multiple new lines.PHP_CodeSniffer/src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php
Lines 114 to 122 in 2c13a90
There may be more issues, but this was just what I saw at first glance, so a thorough review would not go amiss.