From e5b35864564c19cb207aa8a6a7aec4498a17f9e3 Mon Sep 17 00:00:00 2001 From: Steven Lewis Date: Sat, 9 Nov 2024 13:27:28 +0000 Subject: [PATCH] Fix PHP 8.4 E_STRICT deprecation notices (#1921) --- src/Monolog/ErrorHandler.php | 4 ++-- tests/Monolog/ErrorHandlerTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php index 452778b8..805f2dfd 100644 --- a/src/Monolog/ErrorHandler.php +++ b/src/Monolog/ErrorHandler.php @@ -167,7 +167,7 @@ class ErrorHandler E_USER_ERROR => LogLevel::ERROR, E_USER_WARNING => LogLevel::WARNING, E_USER_NOTICE => LogLevel::NOTICE, - E_STRICT => LogLevel::NOTICE, + 2048 => LogLevel::NOTICE, // E_STRICT E_RECOVERABLE_ERROR => LogLevel::ERROR, E_DEPRECATED => LogLevel::NOTICE, E_USER_DEPRECATED => LogLevel::NOTICE, @@ -269,7 +269,7 @@ class ErrorHandler 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', E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', E_DEPRECATED => 'E_DEPRECATED', E_USER_DEPRECATED => 'E_USER_DEPRECATED', diff --git a/tests/Monolog/ErrorHandlerTest.php b/tests/Monolog/ErrorHandlerTest.php index 55025479..930b58f9 100644 --- a/tests/Monolog/ErrorHandlerTest.php +++ b/tests/Monolog/ErrorHandlerTest.php @@ -124,7 +124,7 @@ class ErrorHandlerTest extends \PHPUnit\Framework\TestCase $this->assertEquals('E_USER_ERROR', $method->invokeArgs(null, [E_USER_ERROR])); $this->assertEquals('E_USER_WARNING', $method->invokeArgs(null, [E_USER_WARNING])); $this->assertEquals('E_USER_NOTICE', $method->invokeArgs(null, [E_USER_NOTICE])); - $this->assertEquals('E_STRICT', $method->invokeArgs(null, [E_STRICT])); + $this->assertEquals('E_STRICT', $method->invokeArgs(null, [2048])); $this->assertEquals('E_RECOVERABLE_ERROR', $method->invokeArgs(null, [E_RECOVERABLE_ERROR])); $this->assertEquals('E_DEPRECATED', $method->invokeArgs(null, [E_DEPRECATED])); $this->assertEquals('E_USER_DEPRECATED', $method->invokeArgs(null, [E_USER_DEPRECATED]));