diff --git a/composer.json b/composer.json index da85fa3a4..7ca1aa1df 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "doctrine/dbal": "^3.6 || ^4", "doctrine/deprecations": "^0.5.3 || ^1", "doctrine/event-manager": "^1.2 || ^2.0", - "psr/log": "^1.1.3 || ^2 || ^3", + "psr/log": "^2 || ^3", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", "symfony/var-exporter": "^6.2 || ^7.0" diff --git a/src/Tools/Console/ConsoleLogger.php b/src/Tools/Console/ConsoleLogger.php index 34b5623bd..1cba5a322 100644 --- a/src/Tools/Console/ConsoleLogger.php +++ b/src/Tools/Console/ConsoleLogger.php @@ -73,7 +73,7 @@ public function __construct( * * @param mixed[] $context */ - public function log($level, $message, array $context = []): void + public function log(mixed $level, string|Stringable $message, array $context = []): void { if (! isset($this->verbosityLevelMap[$level])) { throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); diff --git a/tests/Metadata/Storage/DebugLogger.php b/tests/Metadata/Storage/DebugLogger.php index 3a6f14e8a..30ad3b286 100644 --- a/tests/Metadata/Storage/DebugLogger.php +++ b/tests/Metadata/Storage/DebugLogger.php @@ -5,6 +5,7 @@ namespace Doctrine\Migrations\Tests\Metadata\Storage; use Psr\Log\AbstractLogger; +use Stringable; final class DebugLogger extends AbstractLogger { @@ -15,7 +16,7 @@ final class DebugLogger extends AbstractLogger * * @param mixed[] $context */ - public function log($level, $message, array $context = []): void + public function log(mixed $level, string|Stringable $message, array $context = []): void { $this->count++; } diff --git a/tests/TestLogger.php b/tests/TestLogger.php index 385168f7f..7b2e5c6ca 100644 --- a/tests/TestLogger.php +++ b/tests/TestLogger.php @@ -25,7 +25,7 @@ class TestLogger extends AbstractLogger * * @param mixed[] $context */ - public function log($level, $message, array $context = []): void + public function log(mixed $level, string|Stringable $message, array $context = []): void { $this->logs[] = $this->interpolate($message, $context); }