Skip to content

Commit

Permalink
Fix PHP 8.4 E_STRICT deprecation notices (#1921)
Browse files Browse the repository at this point in the history
  • Loading branch information
srjlewis authored Nov 9, 2024
1 parent e266d7d commit e5b3586
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Monolog/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function defaultErrorLevelMap(): array
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,
Expand Down Expand Up @@ -269,7 +269,7 @@ private static function codeToString(int $code): string
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',
Expand Down
2 changes: 1 addition & 1 deletion tests/Monolog/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testCodeToString()
$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]));
Expand Down

0 comments on commit e5b3586

Please sign in to comment.