Conditions | 2 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
29 | public function normalize($object, string $format = null, array $context = []) |
||
30 | { |
||
31 | /** @var ValidationException $object */ |
||
32 | $data = $this->locationableExceptionNormalizer->normalize($object, $format, $context); |
||
33 | $data['errors'] = $object->getErrorBag()->getErrors( |
||
34 | function (ErrorBagField $field) { |
||
35 | $info = $field->getLocalizationInfo(); |
||
36 | if (!$info) { |
||
37 | return $field->getMessage(); |
||
38 | } |
||
39 | return $this->translate($info); |
||
40 | } |
||
41 | ); |
||
42 | return $data; |
||
43 | } |
||
53 |