Skip to content

Commit a413888

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Fix typo Fix deprecated libxml_disable_entity_loader Add Tagalog translations for validator messages 94, 95, 96 and 99 PHPUnit's assertContains() performs strict comparisons now. [ClassLoader][Routing] Fix namespace parsing on php 8. Fix deprecated libxml_disable_entity_loader Made reference to PHPUnit\Util\XML::loadfile php5-compatible. [Validator] Add missing translations for german and vietnamese Modernized deprecated PHPUnit assertion calls [Console] The message of "class not found" errors has changed in php 8. The PHPUnit\Util\XML class has been removed in PHPUnit 9.3. [Console] Make sure we pass a numeric array of arguments to call_user_func_array(). [Serializer] Fix that it will never reach DOMNode [Validator] sync translations [VarDumper] Improve previous fix on light array coloration [Cache] Fix #37667
2 parents 2ebe1c7 + 88de6fd commit a413888

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Dumper/CliDumper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
269269
*/
270270
public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild)
271271
{
272+
if (null === $this->colors) {
273+
$this->colors = $this->supportsColors();
274+
}
275+
272276
$this->dumpKey($cursor);
273277
$attr = $cursor->attr;
274278

@@ -283,8 +287,7 @@ public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild)
283287
} elseif (Cursor::HASH_RESOURCE === $type) {
284288
$prefix = $this->style('note', $class.' resource', $attr).($hasChild ? ' {' : ' ');
285289
} else {
286-
$unstyledPrefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? 'array:'.$class : '';
287-
$prefix = $this->style('note', $unstyledPrefix, $attr).($unstyledPrefix ? ' [' : '[');
290+
$prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class).' [' : '[';
288291
}
289292

290293
if (($cursor->softRefCount || 0 < $cursor->softRefHandle) && empty($attr['cut_hash'])) {

Tests/Dumper/CliDumperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,28 +495,28 @@ public function provideDumpArrayWithColor()
495495
yield [
496496
['foo' => 'bar'],
497497
0,
498-
<<<EOTXT
498+
<<<EOTXT
499499
\e[0;38;5;208m\e[38;5;38marray:1\e[0;38;5;208m [\e[m
500500
\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
501501
\e[0;38;5;208m]\e[m
502502
503503
EOTXT
504504
];
505505

506-
yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[]\e[m\n"];
506+
yield [[], AbstractDumper::DUMP_LIGHT_ARRAY, "\e[0;38;5;208m[]\e[m\n"];
507507

508508
yield [
509509
['foo' => 'bar'],
510510
AbstractDumper::DUMP_LIGHT_ARRAY,
511511
<<<EOTXT
512-
\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[\e[m
512+
\e[0;38;5;208m[\e[m
513513
\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
514514
\e[0;38;5;208m]\e[m
515515
516516
EOTXT
517517
];
518518

519-
yield [[], 0, "\e[0;38;5;208m\e[38;5;38m\e[0;38;5;208m[]\e[m\n"];
519+
yield [[], 0, "\e[0;38;5;208m[]\e[m\n"];
520520
}
521521

522522
/**

0 commit comments

Comments
 (0)