Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
42 | 19 | private function getInitialStub() |
|
43 | { |
||
44 | 19 | $disableConstructor = $this->stubConfiguration[$this->className]['disableConstructor'] ?? false; |
|
45 | |||
46 | 19 | if ($disableConstructor) { |
|
47 | 17 | return $this->testCase->getMockBuilder($this->className) |
|
48 | 17 | ->disableOriginalConstructor() |
|
49 | 17 | ->getMock(); |
|
50 | } |
||
51 | |||
52 | 2 | return $this->testCase->getMockBuilder($this->className) |
|
53 | 2 | ->getMock(); |
|
54 | } |
||
62 |
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.