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...
17
->with($formatDotNet)
18
->andReturn($formatPhp)
19
->once()
20
->getMock();
21
22
$expected = 'i am expected';
23
$date = m::mock(\DateTimeImmutable::class)
24
->shouldReceive('format')
25
->with($formatPhp)
26
->andReturn($expected)
27
->once()
28
->getMock();
29
30
$formatter = new DateFormatterBasic($dotnetDateTime);
$dotnetDateTime of type Mockery\MockInterface is incompatible with the type Urbanplum\DotnetDateTime\DotnetDateTime expected by parameter $dotnetDateTime of Graze\CiffRenderer\Parse...terBasic::__construct().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
30
$formatter = new DateFormatterBasic(/** @scrutinizer ignore-type */ $dotnetDateTime);
$date of type Mockery\MockInterface is incompatible with the type DateTimeInterface expected by parameter $date of Graze\CiffRenderer\Parse...ormatterBasic::format().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
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.