Conditions | 5 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
58 | private function renderArray(array $value): string |
||
59 | { |
||
60 | if (count($value) === 0) { |
||
61 | return '[]'; |
||
62 | } |
||
63 | $result = '['; |
||
64 | foreach ($value as $key => $item) { |
||
65 | $result .= "\n"; |
||
66 | if (!$item instanceof ArrayItemRenderer) { |
||
67 | $result .= is_int($key) ? "{$key} => " : "'{$key}' => "; |
||
68 | } |
||
69 | $result .= $this->renderValue($item) . ','; |
||
70 | } |
||
71 | return str_replace("\n", "\n ", $result) . "\n]"; |
||
72 | } |
||
74 |