| Conditions | 4 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function toArray(): array |
||
| 13 | { |
||
| 14 | $props = $this->getProperties(); |
||
|
|
|||
| 15 | foreach ($props as $key => $value) { |
||
| 16 | if ($value instanceof Model) { |
||
| 17 | $props[$key] = $value->toArray(); |
||
| 18 | } |
||
| 19 | if ($value instanceof Collection) { |
||
| 20 | $props[$key] = $value->toArray(); |
||
| 21 | } |
||
| 22 | } |
||
| 23 | return $props; |
||
| 24 | } |
||
| 30 | } |