Conditions | 7 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
28 | public function toArray() : array |
||
29 | { |
||
30 | $result = []; |
||
31 | |||
32 | foreach ($this as $field => $value) { |
||
33 | if (null === $value) { |
||
34 | continue; |
||
35 | } |
||
36 | |||
37 | if (!is_array($value)) { |
||
38 | $result[$field] = ($value instanceof AnnotationInterface) ? $value->toArray() : $value; |
||
39 | continue; |
||
40 | } |
||
41 | |||
42 | foreach ($value as $key => $item) { |
||
43 | $result[$field][$key] = ($item instanceof AnnotationInterface) ? $item->toArray() : $item; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | return $result; |
||
48 | } |
||
50 |