Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class ActionDispatcherMiddleware implements ServerMiddlewareInterface |
||
15 | { |
||
16 | /** |
||
17 | * The session manager. |
||
18 | * |
||
19 | * @var Dispatcher |
||
20 | */ |
||
21 | protected $dispatcher; |
||
22 | |||
23 | /** |
||
24 | * Create a new session middleware. |
||
25 | * |
||
26 | * @param Dispatcher $dispatcher |
||
27 | */ |
||
28 | public function __construct(Dispatcher $dispatcher) |
||
29 | { |
||
30 | $this->dispatcher = $dispatcher; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @inheritdoc |
||
35 | * @throws \Exception |
||
36 | */ |
||
37 | public function process(ServerRequestInterface $request, RequestHandlerInterface $delegate): ResponseInterface |
||
38 | { |
||
39 | return $this->getDispatcher()->dispatch($request); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return Dispatcher |
||
44 | */ |
||
45 | protected function getDispatcher(): Dispatcher |
||
48 | } |
||
49 | } |
||
50 |