Conditions | 4 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function toArray(): array |
||
10 | { |
||
11 | return array_map( |
||
12 | function ($entity) |
||
13 | { |
||
14 | if ($entity instanceof GenericLazy) { |
||
15 | $entity = $entity->get($this); |
||
16 | } |
||
17 | |||
18 | if ($entity instanceof ToArrayInterface) { |
||
19 | return $entity->toArray(); |
||
20 | } |
||
21 | |||
22 | if (is_object($entity)) { |
||
23 | return (array) $entity; |
||
24 | } |
||
25 | |||
26 | return $entity; |
||
27 | }, |
||
28 | $this->data |
||
29 | ); |
||
32 |