Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public static function recursiveJson($json, string $path = ''): string |
||
19 | { |
||
20 | if (\is_array($json)) { |
||
21 | $return = ''; |
||
22 | foreach ($json as $key => $i) { |
||
23 | $return .= self::recursiveJson($i, $path . '[' . $key . ']'); |
||
24 | } |
||
25 | |||
26 | return $return; |
||
27 | } |
||
28 | |||
29 | return $path . ' => ' . $json . \PHP_EOL; |
||
30 | } |
||
32 |