phpcs-variable-analysis icon indicating copy to clipboard operation
phpcs-variable-analysis copied to clipboard

Ignore unused function arguments in abstract methods

Open sirbrillig opened this issue 6 years ago • 0 comments

@davidrothstein suggested this, and I think it might be a good idea. When an abstract class has methods, those methods may have arguments but no function body (essentially a function signature). We may want to ignore those unused variable warnings.

Example:

<?php

abstract class MasterTestCase {
  protected function doSomething( int $foo, array $bar ) { // this will report two warnings
  }
}

sirbrillig avatar Jun 04 '19 17:06 sirbrillig