Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
47 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
48 | { |
||
49 | $middleware = \current($this->middlewares); |
||
50 | |||
51 | if (!$middleware) { |
||
52 | \reset($this->middlewares); |
||
53 | |||
54 | return $handler->handle($request); |
||
55 | } |
||
56 | |||
57 | \next($this->middlewares); |
||
58 | |||
59 | $requestHandler = new MiddlewareHandler( |
||
60 | $this, |
||
61 | $handler |
||
62 | ); |
||
63 | |||
64 | return $middleware->process($request, $requestHandler); |
||
65 | } |
||
67 |