-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use File::getMethodParameters()
#149
Comments
It looks like it originated in 2011 here: 385b5a8 Sounds like a great idea to replace that. |
As that would require a refactor and the issue with |
That sounds like a good idea. A lot of the code in this sniff has been implemented in a "make the tests pass and we can clean it up later" manner, and I think adding PHPCSUtils is an excellent opportunity to do a lot of that clean up. This week I'm working on launching a major project at work which is taking up pretty much all of my time but I'd love to chat about this in more detail after we're done... maybe next week or the week after? |
I'm prepping for a conference at the moment (or rather: should be) and will be traveling and such for the next two weeks after that. So, realistically, any time after March 9th ;-) |
If you want to have a look at what PHPCSUtils offers in the mean time, the documentation is up: https://phpcsutils.com/ and https://phpcsutils.com/phpdoc/index.html |
phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php
Lines 464 to 467 in 2976bca
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).Ref: https://pear.php.net/package/PHP_CodeSniffer/docs/3.5.4/apidoc/PHP_CodeSniffer/File.html#methodgetMethodParameters
To change this would probably require a refactor, but it would also make the code more stable and simpler.
The text was updated successfully, but these errors were encountered: