1 | <?php |
||
22 | class ValidationExceptionListener extends RestExceptionListener |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var ConstraintUtils |
||
27 | */ |
||
28 | private $constraintUtils; |
||
29 | |||
30 | /** |
||
31 | * set constraint utils |
||
32 | * |
||
33 | * @param ConstraintUtils $utils utils |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | public function setConstraintUtils(ConstraintUtils $utils) |
||
41 | |||
42 | /** |
||
43 | * Handle the exception and send the right response |
||
44 | * |
||
45 | * @param GetResponseForExceptionEvent $event Event |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | public function onKernelException(GetResponseForExceptionEvent $event) |
||
64 | |||
65 | /** |
||
66 | * @param ValidationExceptionError[] $errors errors |
||
67 | * |
||
68 | * @return array |
||
69 | */ |
||
70 | private function getErrorMessages(array $errors) |
||
85 | } |
||
86 |