| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function testCreate() |
||
| 22 | { |
||
| 23 | $this->requestFactory->shouldReceive('createRequest')->andReturn(m::mock(RequestInterface::class)); |
||
|
|
|||
| 24 | $requestBuilder = new RequestBuilder($this->requestFactory); |
||
| 25 | $request = $requestBuilder->create('GET', '/api', [], null); |
||
| 26 | |||
| 27 | $this->assertInstanceOf(RequestInterface::class, $request); |
||
| 28 | } |
||
| 29 | |||
| 36 |
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: