PhpXmlRpc_PolyfillTestCase   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fail() 0 3 1
A _run() 0 2 1
A run() 0 2 1
A _fail() 0 1 1
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) {
0 ignored issues
show
Bug introduced by
The type PHPUnit_Framework_TestResult was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
        return $this->_run($result);
16
    }
17
18
    public static function fail($message = '') {
19
        static::_fail($message);
0 ignored issues
show
Unused Code introduced by
The call to PhpXmlRpc_PolyfillTestCase::_fail() has too many arguments starting with $message. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        static::/** @scrutinizer ignore-call */ 
20
                _fail($message);

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.

Loading history...
20
        parent::fail($message);
21
    }
22
}
23