| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 2 | public function handle(ServerRequestInterface $request): ResponseInterface |
|
| 30 | { |
||
| 31 | 2 | $result = $this->router->match($request); |
|
| 32 | |||
| 33 | 2 | if (!$result->isSuccess()) { |
|
| 34 | 1 | return $this->errorResponder->respond($request, $result->getError()); |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | foreach ($result->getMatchedParams() as $name => $value) { |
|
| 38 | 1 | $request = $request->withAttribute($name, $value); |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | return $result->getMatchedHandler()->handle($request); |
|
| 42 | } |
||
| 43 | } |
||
| 44 |