| Conditions | 6 |
| Paths | 6 |
| Total Lines | 27 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 5 | protected function parseArray(array $array): array |
|
| 18 | { |
||
| 19 | 5 | foreach ($array as $key => $value) { |
|
| 20 | 5 | if ($this->isDateTime($value)) { |
|
| 21 | 1 | $array[$key] = $value->format(DATE_RFC3339); |
|
| 22 | |||
| 23 | 1 | continue; |
|
| 24 | } |
||
| 25 | |||
| 26 | 5 | if ($this->isArrayable($value)) { |
|
| 27 | 1 | $array[$key] = $value->toArray(); |
|
| 28 | |||
| 29 | 1 | continue; |
|
| 30 | } |
||
| 31 | |||
| 32 | 5 | if ($this->isStringable($value)) { |
|
| 33 | 5 | $array[$key] = $value->__toString(); |
|
| 34 | |||
| 35 | 5 | continue; |
|
| 36 | } |
||
| 37 | |||
| 38 | 5 | if (is_array($value)) { |
|
| 39 | 5 | $array[$key] = $this->parseArray($value); |
|
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | 5 | return $array; |
|
| 44 | } |
||
| 66 |