Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | class QueueRunner implements RequestHandlerInterface{ |
||
22 | |||
23 | /** @var \Psr\Http\Server\MiddlewareInterface[] */ |
||
24 | protected array $middlewareStack; |
||
25 | protected RequestHandlerInterface $fallbackHandler; |
||
26 | |||
27 | /** |
||
28 | * constructor. |
||
29 | * |
||
30 | * @param \Psr\Http\Server\MiddlewareInterface[] $middlewareStack |
||
31 | * @param \Psr\Http\Server\RequestHandlerInterface $fallbackHandler |
||
32 | */ |
||
33 | public function __construct(array $middlewareStack, RequestHandlerInterface $fallbackHandler){ |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | public function handle(ServerRequestInterface $request):ResponseInterface{ |
||
42 | |||
43 | if(empty($this->middlewareStack)){ |
||
44 | return $this->fallbackHandler->handle($request); |
||
45 | } |
||
46 | |||
47 | return $this->getMiddleware()->process($request, $this); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | */ |
||
53 | protected function getMiddleware():MiddlewareInterface{ |
||
55 | } |
||
56 | |||
58 |