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