Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
44 | public function extract(AnnotationInterface $annotation, ResourceInterface $object, array $json): array |
||
45 | { |
||
46 | if (!($annotation instanceof Collection)) { |
||
47 | return $json; |
||
48 | } |
||
49 | |||
50 | foreach ($annotation->properties() as $property) { |
||
51 | $array = $json[$property]; |
||
52 | $json[$property] = []; |
||
53 | foreach ($array as $resource) { |
||
54 | $json[$property][] = $this->getHydrator()->extract($annotation->get($property), $resource); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | return $json; |
||
59 | } |
||
60 | } |
||
61 |