| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function __invoke(Request $request, Response $response, array $args) : Response |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | return $this->run($request, $response, $args); |
||
| 36 | } catch (NestedValidationException $e) { |
||
| 37 | // validation error |
||
| 38 | return $response |
||
| 39 | ->withStatus(400) |
||
| 40 | ->withJson(['message' => $e->getFullMessage()]); |
||
| 41 | } catch (ModelNotFoundException $e) { |
||
| 42 | throw new NotFoundException($request, $response); |
||
| 43 | } |
||
| 44 | } |
||
| 45 | } |
||
| 46 |