Fix #20282: Fix compatibility with PHP 8.4: deprecated constant E_STRICT

This commit is contained in:
Viktor Khokhryakov
2024-12-06 13:31:20 +04:00
committed by GitHub
parent 80f2545cf1
commit 5df412df2c
3 changed files with 12 additions and 3 deletions

View File

@ -124,15 +124,14 @@ class ErrorException extends \ErrorException
E_NOTICE => 'PHP Notice',
E_PARSE => 'PHP Parse Error',
E_RECOVERABLE_ERROR => 'PHP Recoverable Error',
E_STRICT => 'PHP Strict Warning',
E_USER_DEPRECATED => 'PHP User Deprecated Warning',
E_USER_ERROR => 'PHP User Error',
E_USER_NOTICE => 'PHP User Notice',
E_USER_WARNING => 'PHP User Warning',
E_WARNING => 'PHP Warning',
self::E_HHVM_FATAL_ERROR => 'HHVM Fatal Error',
];
] + (PHP_VERSION_ID < 80400 ? [E_STRICT => 'PHP Strict Warning'] : []);
return isset($names[$this->getCode()]) ? $names[$this->getCode()] : 'Error';
return $names[$this->getCode()] ?? 'Error';
}
}