Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
26 | { |
||
27 | $controller = $this->container->get($this->class); |
||
28 | $action = $request->getAttribute('action'); |
||
29 | if ($action === null) { |
||
30 | throw new \RuntimeException('WebActionsCaller route does not contain action attribute.'); |
||
31 | } |
||
32 | |||
33 | if (!method_exists($controller, $action)) { |
||
34 | return $handler->handle($request); |
||
35 | } |
||
36 | |||
37 | return (new Injector($this->container))->invoke([$controller, $action], [$request, $handler]); |
||
38 | } |
||
40 |