| Conditions | 3 |
| Paths | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | protected function renderArray($value, $indent, $allow_env) |
||
| 24 | { |
||
| 25 | $indentParent = str_repeat(' ', $indent); |
||
| 26 | $indentChildren = str_repeat(' ', $indent + 1); |
||
| 27 | |||
| 28 | if (empty($value)) { |
||
| 29 | return "[\n$indentChildren//\n$indentParent]"; |
||
| 30 | } |
||
| 31 | |||
| 32 | $arrayContent = collect($value) |
||
| 33 | ->map(function ($v, $k) use ($indent, $allow_env, $indentChildren) { |
||
| 34 | $v = $this->render($v, $indent + 1, $allow_env); |
||
| 35 | |||
| 36 | return is_string($k) |
||
| 37 | ? "$indentChildren'$k' => $v" |
||
| 38 | : "$indentChildren$v"; |
||
| 39 | }) |
||
| 40 | ->implode(",\n"); |
||
| 41 | |||
| 42 | return "[\n$arrayContent,\n$indentParent]"; |
||
| 43 | } |
||
| 44 | } |
||
| 45 |