-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
Lines 464 to 467 in 2976bca
// Are we a function or closure parameter? | |
// It would be nice to get the list of function parameters from watching for | |
// T_FUNCTION, but AbstractVariableSniff and AbstractScopeSniff define everything | |
// we need to do that as private or final, so we have to do it this hackish way. |
I have no clue how old that comment is, but it definitely isn't valid anymore and hasn't been valid for a long time.
The File::getMethodParameters()
utility method can retrieve information on all declared parameters for functions, closures (since PHPCS 2.8.0), arrow functions (since PHPCS 3.5.4) and closure use statements (since PHPCS 3.5.0).
To change this would probably require a refactor, but it would also make the code more stable and simpler.