From 611cd38bc89b595640f1b1af8280bbd68d051ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 24 Aug 2024 09:53:07 +0200 Subject: [PATCH] Add phpdoc for LogInterface::log() $message argument PHPStan complains that it is not specified. Looking at the method signature of Psr\Log\LoggerTrait, it appears that $level uses a phpdoc, and both $message and $context use native type declarations, so the corresponding phpdoc was removed in 3.0.1 --- src/Tools/Console/ConsoleLogger.php | 3 ++- tests/Metadata/Storage/DebugLogger.php | 4 +++- tests/TestLogger.php | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Tools/Console/ConsoleLogger.php b/src/Tools/Console/ConsoleLogger.php index 34b5623bd..800c20c14 100644 --- a/src/Tools/Console/ConsoleLogger.php +++ b/src/Tools/Console/ConsoleLogger.php @@ -71,7 +71,8 @@ public function __construct( /** * {@inheritDoc} * - * @param mixed[] $context + * @param string|Stringable $message + * @param mixed[] $context */ public function log($level, $message, array $context = []): void { diff --git a/tests/Metadata/Storage/DebugLogger.php b/tests/Metadata/Storage/DebugLogger.php index 3a6f14e8a..3ae60c70c 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 { @@ -13,7 +14,8 @@ final class DebugLogger extends AbstractLogger /** * {@inheritDoc} * - * @param mixed[] $context + * @param string|Stringable $message + * @param mixed[] $context */ public function log($level, $message, array $context = []): void { diff --git a/tests/TestLogger.php b/tests/TestLogger.php index 385168f7f..239bad46f 100644 --- a/tests/TestLogger.php +++ b/tests/TestLogger.php @@ -23,7 +23,8 @@ class TestLogger extends AbstractLogger /** * {@inheritDoc} * - * @param mixed[] $context + * @param string|Stringable $message + * @param mixed[] $context */ public function log($level, $message, array $context = []): void {