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