-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squiz/MultiLineFunctionDeclaration: bug fix - skip over attributes
The sniff looks for `T_COMMA` tokens to find the start of the next parameter and skips over parenthesis sets and square brackets sets (like short arrays) to prevent mismatching on a `T_COMMA` which is not a parameter separator. This logic did not take parameter attributes into account, which can contain multiple comma-separated attributes, so should also be skipped over. Fixed now. Includes plenty of tests. Also includes minor stability fix for the parentheses/square brackets skipping. Notes: * It could be argued that the sniff should use the `File::getMethodParameters()` method to do the parameter parsing instead. This could be done in a future iteration, but will need to be evaluated carefully for side-effects. * This sniff extends the PEAR `FunctionDeclaration` sniff. It has been verified that that sniff is not affected by this bug. Fixes 608
- Loading branch information
Showing
4 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters