| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 23 | public static function processArray(array $data): array |
|
| 18 | { |
||
| 19 | 23 | $rtn = []; |
|
| 20 | 23 | foreach ($data as $k => $v) { |
|
| 21 | 23 | if ($v instanceof Arrayable) { |
|
| 22 | 5 | $rtn[$k] = $v->toArray(); |
|
| 23 | 5 | continue; |
|
| 24 | } |
||
| 25 | 23 | if (is_array($v)) { |
|
| 26 | 5 | $rtn[$k] = self::processArray($v); |
|
| 27 | 5 | continue; |
|
| 28 | } |
||
| 29 | 23 | $rtn[$k] = $v; |
|
| 30 | } |
||
| 31 | 23 | return $rtn; |
|
| 32 | } |
||
| 34 |