| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 10 | 
| Code Lines | 6 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 27 | private function getWebhookExchangeRepository() | ||
| 28 |     { | ||
| 29 | /** @var WebhookExchangeRepository|\PHPUnit_Framework_MockObject_MockObject $webhookExchangeRepository */ | ||
| 30 | $webhookExchangeRepository = $this->getMockBuilder(WebhookExchangeRepository::class) | ||
| 31 | ->disableOriginalConstructor() | ||
| 32 | ->setMethods(['findOneBy']) | ||
| 33 | ->getMock(); | ||
| 34 | |||
| 35 | return $webhookExchangeRepository; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | 
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: