Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | public function handle(ServerRequestInterface $request): ResponseInterface |
||
51 | { |
||
52 | // nulled middleware |
||
53 | if (is_null($this->middleware)) { |
||
54 | return ($this->handler)($request); |
||
55 | } |
||
56 | |||
57 | // middleware interface |
||
58 | if ( |
||
59 | $this->middleware instanceof MiddlewareInterface && |
||
60 | $this->handler instanceof RequestHandlerInterface |
||
61 | ) { |
||
62 | return $this->middleware->process($request, $this->handler); |
||
63 | } |
||
64 | |||
65 | // callable middleware |
||
66 | return ($this->middleware)($request, $this->handler); |
||
67 | } |
||
68 | } |