PHP unused parameter validation is reported where shouldn't

Please consider the following PHP code:

class A {
public function foo($a, $b)
{
return $a;
}
}

class B extends A {
public function foo($a, $b)
{
return $a + $b;
}
}

Parameter $b is reported as unused in class A. IDE clearly understands that method foo is overridden by other classes that use parameter $b. Why reporting it as unused? Any way to get rid of this warning without suppressing it?

1 comment
Comment actions Permalink

It's a missing feature, we can ignore unused parameters of overriding methods but can't do the same for overridden ones. Please vote: https://youtrack.jetbrains.com/issue/WI-27462

0

Please sign in to leave a comment.