| Conditions | 4 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 38 | 1 | public function getReferencedObjects(SimpleAnnotationReader $annotationReader) : array |
|
| 39 | { |
||
| 40 | 1 | $fields = $this->getFields(); |
|
| 41 | 1 | $objects = []; |
|
| 42 | |||
| 43 | array_walk_recursive($fields, function ($value) use ($annotationReader, &$objects) { |
||
| 44 | 1 | if ($value instanceof AbstractAnnotation) { |
|
| 45 | 1 | $objects = array_merge($objects, $value->getReferencedObjects($annotationReader)); |
|
| 46 | 1 | } elseif ($value instanceof AbstractAnnotationReference) { |
|
| 47 | 1 | $object = $value->getAnnotation($annotationReader); |
|
| 48 | 1 | $objects[] = $object; |
|
| 49 | |||
| 50 | 1 | if ($object instanceof AbstractAnnotation) { |
|
| 51 | 1 | $objects = array_merge($objects, $object->getReferencedObjects($annotationReader)); |
|
| 52 | } |
||
| 53 | } |
||
| 54 | 1 | }); |
|
| 55 | |||
| 56 | 1 | return $objects; |
|
| 57 | } |
||
| 59 |