Closed defunctl closed 1 year ago
Interesting! Constructor promotion support was added in https://github.com/sirbrillig/phpcs-variable-analysis/pull/266 but I bet that the readonly
token could be breaking the logic.
@sirbrillig FYI, in case it helps: the PHPCS native File::getMethodParameters()
method has support for both, but using that would require some changes in how things are being sniffed (or detection of a function declaration based on the parentheses surrounding parameters and using the method that way).
Just ran into this one myself now ;-)
https://github.com/sirbrillig/phpcs-variable-analysis/pull/294 should fix this.
Much appreciated @sirbrillig !
The following throws this error:
phpcs: VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable: Unused function parameter $message.
PHP Version: 8.1 Variable Analysis Version: v2.11.10