Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 5.3197 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types = 1); |
||
45 | 1 | public function next(ServerRequestInterface $request): ResponseInterface |
|
46 | { |
||
47 | // Add current route to the request. |
||
48 | 1 | $request = $request->withAttribute('route', $this->route); |
|
49 | |||
50 | 1 | if ($this->invoker->isCallable($this->route->domain())) { |
|
51 | if ($this->invoker->isCallable([$this->route->input(), 'process'])) { |
||
52 | $arguments = $this->invoker->call([$this->route->input(), 'process'], [$request]); |
||
53 | } |
||
54 | /** @var Payload $payload */ |
||
55 | $payload = $this->invoker->call($this->route->domain(), $arguments ?? []); |
||
56 | } |
||
57 | 1 | return $this->invoker->call([$this->route->responder(), 'run'], [$request, $payload ?? null]); |
|
58 | } |
||
59 | |||
60 | } |