I played a little with the UnusedParameter check in the
new 3.2 release. I found that the check is applied to
every method. But many public (or protected) methods
override methods in the superclass (or implement
methods of interfaces) and you have no choice to omit
the parameters you don't use.
Or, maybe the other way round, a base class declares a
parameter in a method which is designed to be
overridden, and subclassed might use the parameter, but
it is not used in the base class.
So, not using a parameter in public or protected
methods is OK!
I wouldn't say that the current implementation of the
check is useless, but it produces a lot of useless
It would be very useful to limit the check to private
or static methods (and constructors), where no
inheritence take place.
(It would be even more useful to check parameters of
public methods which have no implementation in the
superclasses, or which are no interface methods, but I
don't know if this is possible).
Log in to post a comment.