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