Conditions | 6 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
28 | public function toArray() : array |
||
29 | { |
||
30 | $fields = $this->getFields(); |
||
31 | |||
32 | $result = []; |
||
33 | foreach ($fields as $field => $value) { |
||
34 | if (!is_array($value)) { |
||
35 | $result[$field] = ($value instanceof AnnotationInterface) ? $value->toArray() : $value; |
||
36 | continue; |
||
37 | } |
||
38 | |||
39 | foreach ($value as $key => $item) { |
||
40 | $result[$field][$key] = ($item instanceof AnnotationInterface) ? $item->toArray() : $item; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | return $result; |
||
45 | } |
||
62 |