| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function testProcess() |
||
| 20 | { |
||
| 21 | $router = new Router(); |
||
| 22 | |||
| 23 | $dispatcher = new Dispatcher( |
||
| 24 | [ |
||
|
|
|||
| 25 | new RouteResolverMiddleware($router), |
||
| 26 | function () { |
||
| 27 | return (new Response())->setContent('test'); |
||
| 28 | }, |
||
| 29 | ] |
||
| 30 | ); |
||
| 31 | |||
| 32 | /** @var Response $response */ |
||
| 33 | $response = $dispatcher->dispatch(new Request()); |
||
| 34 | |||
| 35 | self::assertInstanceOf(Response::class, $response); |
||
| 36 | self::assertSame('test', $response->getContent()); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: