Conditions | 3 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
35 | * |
||
36 | * @return ComponentObjectInterface[] |
||
37 | */ |
||
38 | public function fetchComponentObjects(SimpleAnnotationReader $annotationReader) : array |
||
39 | { |
||
40 | $fields = $this->getFields(); |
||
41 | $objects = []; |
||
42 | |||
43 | array_walk_recursive($fields, function ($value) use ($annotationReader, &$objects) { |
||
44 | if ($value instanceof AbstractAnnotation) { |
||
45 | $objects = array_merge($objects, $value->fetchComponentObjects($annotationReader)); |
||
46 | } elseif ($value instanceof AbstractReference) { |
||
47 | $object = $value->getAnnotation($annotationReader); |
||
48 | $objects[] = $object; |
||
49 | |||
50 | if ($object instanceof AbstractAnnotation) { |
||
51 | $objects = array_merge($objects, $object->fetchComponentObjects($annotationReader)); |
||
52 | } |
||
53 | } |
||
54 | }); |
||
55 | |||
59 |