| Conditions | 3 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 5 | public function normalize($object, $format = null, array $context = []) |
|
| 14 | { |
||
| 15 | 5 | $data = parent::normalize($object, $format, $context); |
|
| 16 | 5 | $data = $data['errors']['children']; |
|
| 17 | |||
| 18 | 5 | $data = array_filter($data, function ($child) { |
|
| 19 | 5 | return isset($child['errors']) && count($child['errors']) > 0; |
|
| 20 | 5 | }); |
|
| 21 | |||
| 22 | 5 | $data = array_map(function ($child) { |
|
| 23 | 5 | return isset($child['errors']) ? $child['errors'] : []; |
|
| 24 | 5 | }, $data); |
|
| 25 | |||
| 26 | 5 | return $data; |
|
| 27 | } |
||
| 29 |