Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 0 |
1 | <?php |
||
35 | 3 | public function extract(AnnotationInterface $annotation, ResourceInterface $object, array $json): array |
|
36 | { |
||
37 | 3 | if (!($annotation instanceof Nested)) { |
|
38 | return $json; |
||
39 | } |
||
40 | |||
41 | 3 | foreach ($annotation->properties() as $property) { |
|
42 | 3 | if (!($json[$property] instanceof ResourceInterface)) { |
|
43 | 1 | continue; |
|
44 | } |
||
45 | |||
46 | 2 | $json[$property] = $this->getHydrator()->extract($annotation->get($property), $json[$property]); |
|
47 | } |
||
48 | |||
49 | 3 | return $json; |
|
50 | } |
||
51 | } |
||
52 |