From e4de722fefc6329fc53bec5fcbb53b65e2443e28 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 22 Jul 2024 14:51:40 +0200 Subject: [PATCH 1/2] [ErrorHandler][VarDumper] Remove PHP 8.4 deprecations --- Caster/DOMCaster.php | 9 +-------- Caster/ExceptionCaster.php | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Caster/DOMCaster.php b/Caster/DOMCaster.php index 4dd16e0e..5d933cf7 100644 --- a/Caster/DOMCaster.php +++ b/Caster/DOMCaster.php @@ -23,7 +23,7 @@ class DOMCaster { private const ERROR_CODES = [ - \DOM_PHP_ERR => 'DOM_PHP_ERR', + 0 => 'DOM_PHP_ERR', \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR', \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR', \DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR', @@ -138,16 +138,12 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo 'doctype' => $dom->doctype, 'implementation' => $dom->implementation, 'documentElement' => new CutStub($dom->documentElement), - 'actualEncoding' => $dom->actualEncoding, 'encoding' => $dom->encoding, 'xmlEncoding' => $dom->xmlEncoding, - 'standalone' => $dom->standalone, 'xmlStandalone' => $dom->xmlStandalone, - 'version' => $dom->version, 'xmlVersion' => $dom->xmlVersion, 'strictErrorChecking' => $dom->strictErrorChecking, 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI, - 'config' => $dom->config, 'formatOutput' => $dom->formatOutput, 'validateOnParse' => $dom->validateOnParse, 'resolveExternals' => $dom->resolveExternals, @@ -275,9 +271,6 @@ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $i 'publicId' => $dom->publicId, 'systemId' => $dom->systemId, 'notationName' => $dom->notationName, - 'actualEncoding' => $dom->actualEncoding, - 'encoding' => $dom->encoding, - 'version' => $dom->version, ]; return $a; diff --git a/Caster/ExceptionCaster.php b/Caster/ExceptionCaster.php index 7f5cb65e..d3f5e123 100644 --- a/Caster/ExceptionCaster.php +++ b/Caster/ExceptionCaster.php @@ -41,7 +41,7 @@ class ExceptionCaster \E_USER_ERROR => 'E_USER_ERROR', \E_USER_WARNING => 'E_USER_WARNING', \E_USER_NOTICE => 'E_USER_NOTICE', - \E_STRICT => 'E_STRICT', + 2048 => 'E_STRICT', ]; private static $framesCache = []; From e0a521ee65dd62dfc878fbca159a9d78a52c02ca Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Wed, 24 Jul 2024 10:06:13 +0200 Subject: [PATCH 2/2] [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling --- Dumper/CliDumper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dumper/CliDumper.php b/Dumper/CliDumper.php index 3e86e4ab..359171b3 100644 --- a/Dumper/CliDumper.php +++ b/Dumper/CliDumper.php @@ -606,7 +606,7 @@ private function hasColorSupport($stream): bool } // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) { return false; }