Skip to content

Commit

Permalink
ix array format
Browse files Browse the repository at this point in the history
  • Loading branch information
timvandijck committed Sep 8, 2023
1 parent 9360569 commit 31e07c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Support/PlainTextDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,20 @@ private static function dumpInternal($var, $level): void

case 'array':
if (self::$depth <= $level) {
self::$output .= '[...]';

self::$output .= '[...],';
} elseif (empty($var)) {
self::$output .= '[]';
self::$output .= '[],';
} else {
$keys = array_keys($var);
$spaces = str_repeat(' ', $level * 4);
self::$output .= "[\n" . $spaces;
self::$output .= "[" . $spaces;
foreach ($keys as $key) {
self::$output .= "\n" . $spaces . ' ';
self::dumpInternal($key, 0);
self::$output .= ' => ';
self::dumpInternal($var[$key], $level + 1);
self::$output .= ',';
}
self::$output .= "\n" . $spaces . ']';
}
Expand Down

0 comments on commit 31e07c3

Please sign in to comment.