[VarDumper] Improve previous fix on light array coloration
This commit is contained in:
parent
cc827466bb
commit
cef16f591f
@ -255,6 +255,10 @@ class CliDumper extends AbstractDumper
|
||||
*/
|
||||
public function enterHash(Cursor $cursor, $type, $class, $hasChild)
|
||||
{
|
||||
if (null === $this->colors) {
|
||||
$this->colors = $this->supportsColors();
|
||||
}
|
||||
|
||||
$this->dumpKey($cursor);
|
||||
|
||||
if ($this->collapseNextHash) {
|
||||
@ -268,8 +272,7 @@ class CliDumper extends AbstractDumper
|
||||
} elseif (Cursor::HASH_RESOURCE === $type) {
|
||||
$prefix = $this->style('note', $class.' resource').($hasChild ? ' {' : ' ');
|
||||
} else {
|
||||
$unstyledPrefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? 'array:'.$class : '';
|
||||
$prefix = $this->style('note', $unstyledPrefix).($unstyledPrefix ? ' [' : '[');
|
||||
$prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '[';
|
||||
}
|
||||
|
||||
if ($cursor->softRefCount || 0 < $cursor->softRefHandle) {
|
||||
|
@ -578,7 +578,7 @@ EOTXT
|
||||
yield [
|
||||
['foo' => 'bar'],
|
||||
0,
|
||||
<<<EOTXT
|
||||
<<<EOTXT
|
||||
\e[0;38;5;208m\e[38;5;38marray:1\e[0;38;5;208m [\e[m
|
||||
\e[0;38;5;208m"\e[38;5;113mfoo\e[0;38;5;208m" => "\e[1;38;5;113mbar\e[0;38;5;208m"\e[m
|
||||
\e[0;38;5;208m]\e[m
|
||||
@ -586,20 +586,20 @@ EOTXT
|
||||
EOTXT
|
||||
];
|
||||
|
||||
yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[]\e[m\n"];
|
||||
yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m[]\e[m\n"];
|
||||
|
||||
yield [
|
||||
['foo' => 'bar'],
|
||||
AbstractDumper::DUMP_LIGHT_ARRAY,
|
||||
<<<EOTXT
|
||||
\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[\e[m
|
||||
\e[0;38;5;208m[\e[m
|
||||
\e[0;38;5;208m"\e[38;5;113mfoo\e[0;38;5;208m" => "\e[1;38;5;113mbar\e[0;38;5;208m"\e[m
|
||||
\e[0;38;5;208m]\e[m
|
||||
|
||||
EOTXT
|
||||
];
|
||||
|
||||
yield [[], 0, "\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[]\e[m\n"];
|
||||
yield [[], 0, "\e[0;38;5;208m[]\e[m\n"];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user