Skip to content

Commit

Permalink
Add phpdoc for LogInterface::log() $message argument
Browse files Browse the repository at this point in the history
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
  • Loading branch information
greg0ire committed Aug 24, 2024
1 parent 535a70d commit 611cd38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Tools/Console/ConsoleLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 3 additions & 1 deletion tests/Metadata/Storage/DebugLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\Migrations\Tests\Metadata\Storage;

use Psr\Log\AbstractLogger;
use Stringable;

final class DebugLogger extends AbstractLogger
{
Expand All @@ -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
{
Expand Down
3 changes: 2 additions & 1 deletion tests/TestLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 611cd38

Please sign in to comment.