Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testFormat() |
||
11 | { |
||
12 | $dayOfYear = 3; |
||
13 | $date = m::mock(\DateTimeImmutable::class) |
||
14 | ->shouldReceive('format') |
||
|
|||
15 | ->with('z') |
||
16 | ->andReturn($dayOfYear) |
||
17 | ->getMock(); |
||
18 | $format = 'i am format'; |
||
19 | |||
20 | $formatter = new DateFormatterDayOfYearFixedLength(); |
||
21 | $actual = $formatter->format($date, $format); |
||
22 | |||
23 | $this->assertSame('004', $actual); |
||
24 | } |
||
26 |
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.