| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function testReturnObject() |
||
| 23 | { |
||
| 24 | $webhookExchangeRepository = $this->getWebhookExchangeRepository(); |
||
| 25 | |||
| 26 | $url = 'https://www.example.com'; |
||
| 27 | $obj = new WebhookExchange($url); |
||
| 28 | $webhookExchangeRepository |
||
| 29 | ->method('findOneBy') |
||
| 30 | ->willReturn($obj); |
||
| 31 | |||
| 32 | $this->assertSame($obj, $webhookExchangeRepository->findByUrl($url)); |
||
| 33 | } |
||
| 34 | |||
| 49 |
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: