| Conditions | 4 |
| Paths | 4 |
| Total Lines | 30 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function getChildren(ReflectionClass $class): array |
||
| 28 | { |
||
| 29 | $children = []; |
||
| 30 | |||
| 31 | foreach ( |
||
| 32 | $this->getClassAnnotations( |
||
| 33 | $class, |
||
| 34 | AddChild::class |
||
| 35 | ) as $annotation |
||
| 36 | ) { |
||
| 37 | if (!isset($annotation->class)) { |
||
| 38 | throw new MissingAnnotationArgumentException( |
||
| 39 | $annotation, |
||
| 40 | 'class', |
||
| 41 | $class |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | if (!isset($annotation->field)) { |
||
| 46 | throw new MissingAnnotationArgumentException( |
||
| 47 | $annotation, |
||
| 48 | 'field', |
||
| 49 | $class |
||
| 50 | ); |
||
| 51 | } |
||
| 52 | |||
| 53 | $children[$annotation->class] = $annotation->field; |
||
| 54 | } |
||
| 55 | |||
| 56 | return $children; |
||
| 57 | } |
||
| 60 |