1
0
Fork 0

Always show deprecation notices even if silenced

pull/10809/head
Jordi Boggiano 2022-05-24 17:35:50 +02:00
parent d70b580899
commit 865886e5c5
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 2 deletions

View File

@ -38,8 +38,10 @@ class ErrorHandler
*/
public static function handle(int $level, string $message, string $file, int $line): bool
{
$isDeprecationNotice = $level === E_DEPRECATED || $level === E_USER_DEPRECATED;
// error code is not included in error_reporting
if (!(error_reporting() & $level)) {
if (!$isDeprecationNotice && !(error_reporting() & $level)) {
return true;
}
@ -48,7 +50,7 @@ class ErrorHandler
"\na legitimately suppressed error that you were not supposed to see.";
}
if ($level !== E_DEPRECATED && $level !== E_USER_DEPRECATED) {
if (!$isDeprecationNotice) {
throw new \ErrorException($message, 0, $level, $file, $line);
}