| Conditions | 5 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function format($data) |
||
| 27 | { |
||
| 28 | if (! is_array($data)) { |
||
| 29 | $data = (array) $data; |
||
| 30 | } |
||
| 31 | |||
| 32 | $array = []; |
||
| 33 | |||
| 34 | foreach ($data as $key => $value) { |
||
| 35 | if (is_object($value) || is_array($value)) { |
||
| 36 | $array[$key] = $this->format($value); |
||
| 37 | } else { |
||
| 38 | $array[$key] = $value; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | return $array; |
||
| 43 | } |
||
| 53 |