Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
25 | 12 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
26 | { |
||
27 | try { |
||
28 | 12 | return $handler->handle($request); |
|
29 | 2 | } catch (ApplicationException $e) { |
|
30 | 1 | $code = $this->httpExceptionMapper->getCode($e); |
|
31 | |||
32 | 1 | return $this->dataResponseFactory->createResponse($e->getMessage(), $code); |
|
33 | 1 | } catch (RequestValidationException $e) { |
|
34 | 1 | return $this->dataResponseFactory->createResponse($e->getFirstError(), Status::BAD_REQUEST); |
|
35 | } |
||
38 |