mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-01 10:50:21 +02:00
Adjust phpdoc to match the psr/log 3 interface, refs #1589
This commit is contained in:
@@ -17,6 +17,7 @@ use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\InvalidArgumentException;
|
||||
use Psr\Log\LogLevel;
|
||||
use Throwable;
|
||||
use Stringable;
|
||||
|
||||
/**
|
||||
* Monolog log channel
|
||||
@@ -482,14 +483,18 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param int|string $level The log level
|
||||
* @param string $message The log message
|
||||
* @param mixed $level The log level
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*
|
||||
* @phpstan-param Level|LevelName|LogLevel::* $level
|
||||
*/
|
||||
public function log($level, $message, array $context = []): void
|
||||
{
|
||||
if (!is_int($level) && !is_string($level)) {
|
||||
throw new \InvalidArgumentException('$level is expected to be a string or int');
|
||||
}
|
||||
|
||||
$level = static::toMonologLevel($level);
|
||||
|
||||
$this->addRecord($level, (string) $message, $context);
|
||||
@@ -500,7 +505,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function debug($message, array $context = []): void
|
||||
@@ -513,7 +518,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function info($message, array $context = []): void
|
||||
@@ -526,7 +531,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function notice($message, array $context = []): void
|
||||
@@ -539,7 +544,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function warning($message, array $context = []): void
|
||||
@@ -552,7 +557,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function error($message, array $context = []): void
|
||||
@@ -565,7 +570,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function critical($message, array $context = []): void
|
||||
@@ -578,7 +583,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function alert($message, array $context = []): void
|
||||
@@ -591,7 +596,7 @@ class Logger implements LoggerInterface, ResettableInterface
|
||||
*
|
||||
* This method allows for compatibility with common interfaces.
|
||||
*
|
||||
* @param string $message The log message
|
||||
* @param string|Stringable $message The log message
|
||||
* @param mixed[] $context The log context
|
||||
*/
|
||||
public function emergency($message, array $context = []): void
|
||||
|
Reference in New Issue
Block a user