1 | <?php |
||
2 | |||
3 | use Yoast\PHPUnitPolyfills\TestCases\TestCase; |
||
4 | |||
5 | // allow hooking code to run within `run` and `fail` via defining `_run` and `_fail` in subclasses |
||
6 | abstract class PhpXmlRpc_PolyfillTestCase extends TestCase |
||
7 | { |
||
8 | public function _run($result = null) { |
||
9 | return parent::run($result); |
||
10 | } |
||
11 | |||
12 | public static function _fail() {} |
||
13 | |||
14 | public function run(PHPUnit_Framework_TestResult $result = null) { |
||
15 | return $this->_run($result); |
||
16 | } |
||
17 | |||
18 | public static function fail($message = '') { |
||
19 | static::_fail($message); |
||
0 ignored issues
–
show
|
|||
20 | parent::fail($message); |
||
21 | } |
||
22 | } |
||
23 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.