You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a standard way to indicate that a parameter is unused #1
cc @ondrejmirtes@muglug@staabm - I can see this being useful to avoid the need to rename parameters to suppress warnings for individual parameters, as well as to avoid different suppression annotations for different tools
When named parameters are a thing with php8 renaming a parameter could be a bc break, therefore using a annotation to indicate this sounds more robust.
Also, it seems like it would be unnecessarily duplication to need to specify the type, and some tools might treat leaving out the type (@param $arg @unused-param) as hinting something is mixed, or a code smell.
So adding a new annotation such as /** @unused-param [...]$paramName */ is another possibility, possibly in combination with the modifier on @param (not sure how variadic params should be referred to as)
Some tools might treat this as marking the function as unused. That's probably a bug if the hyphen isn't checked for.
Activity
TysonAndre commentedon Jul 14, 2020
cc @ondrejmirtes @muglug @staabm - I can see this being useful to avoid the need to rename parameters to suppress warnings for individual parameters, as well as to avoid different suppression annotations for different tools
staabm commentedon Jul 14, 2020
When named parameters are a thing with php8 renaming a parameter could be a bc break, therefore using a annotation to indicate this sounds more robust.
👍
Support `@unused-param` annotation as an alias.
TysonAndre commentedon Aug 5, 2020
Also, it seems like it would be unnecessarily duplication to need to specify the type, and some tools might treat leaving out the type (
@param $arg @unused-param) as hinting something is mixed, or a code smell.So adding a new annotation such as
/** @unused-param [...]$paramName */is another possibility, possibly in combination with the modifier on@param(not sure how variadic params should be referred to as)