Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | private function getPaymentRepository() |
||
38 | { |
||
39 | /** @var PaymentRepository|\PHPUnit_Framework_MockObject_MockObject $paymentRepository */ |
||
40 | $paymentRepository = $this->getMockBuilder(PaymentRepository::class) |
||
41 | ->disableOriginalConstructor() |
||
42 | ->setMethods(['findOneBy']) |
||
43 | ->getMock(); |
||
44 | |||
45 | return $paymentRepository; |
||
46 | } |
||
47 | } |
||
48 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: