Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 3 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
34 | { |
||
35 | 3 | $controller = $this->container->get($this->class); |
|
36 | 3 | $action = $request->getAttribute('action'); |
|
37 | 3 | if ($action === null) { |
|
38 | 1 | throw new \RuntimeException('WebActionsCaller route does not contain action attribute.'); |
|
39 | } |
||
40 | |||
41 | 2 | if (!method_exists($controller, $action)) { |
|
42 | 1 | return $handler->handle($request); |
|
43 | } |
||
44 | |||
45 | 1 | return (new Injector($this->container))->invoke([$controller, $action], [$request, $handler]); |
|
46 | } |
||
48 |