Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function getErrorResponse(ConstraintViolationListInterface $errors) |
||
25 | { |
||
26 | return new JsonResponse([ |
||
27 | 'message' => 'Please check your data', |
||
28 | 'errors' => array_map(function (ConstraintViolation $violation) { |
||
29 | return [ |
||
30 | 'path' => $violation->getPropertyPath(), |
||
31 | 'message' => $violation->getMessage(), |
||
32 | ]; |
||
33 | }, iterator_to_array($errors)), |
||
34 | ], 400); |
||
35 | } |
||
36 | } |
||
37 |