Conditions | 4 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
38 | public function getReferencedObjects(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->getReferencedObjects($annotationReader)); |
||
46 | } elseif ($value instanceof AbstractAnnotationReference) { |
||
47 | $object = $value->getAnnotation($annotationReader); |
||
48 | $objects[] = $object; |
||
49 | |||
50 | if ($object instanceof AbstractAnnotation) { |
||
51 | $objects = array_merge($objects, $object->getReferencedObjects($annotationReader)); |
||
52 | } |
||
53 | } |
||
54 | }); |
||
55 | |||
56 | return $objects; |
||
57 | } |
||
59 |