diff --git a/src/Monolog/Handler/AmqpHandler.php b/src/Monolog/Handler/AmqpHandler.php index ba45dd51..33fffccd 100644 --- a/src/Monolog/Handler/AmqpHandler.php +++ b/src/Monolog/Handler/AmqpHandler.php @@ -32,14 +32,14 @@ class AmqpHandler extends AbstractProcessingHandler /** * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use - * @param string $exchangeName Optional exchange name, for AMQPChannel (PhpAmqpLib) only + * @param string|null $exchangeName Optional exchange name, for AMQPChannel (PhpAmqpLib) only * @param string|int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not */ public function __construct($exchange, ?string $exchangeName = null, $level = Logger::DEBUG, bool $bubble = true) { if ($exchange instanceof AMQPChannel) { - $this->exchangeName = $exchangeName; + $this->exchangeName = (string) $exchangeName; } elseif (!$exchange instanceof AMQPExchange) { throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required'); } elseif ($exchangeName) { diff --git a/src/Monolog/Handler/BrowserConsoleHandler.php b/src/Monolog/Handler/BrowserConsoleHandler.php index 620e2e67..7ff2b160 100755 --- a/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/src/Monolog/Handler/BrowserConsoleHandler.php @@ -74,7 +74,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler } } - public function close() + public function close(): void { self::resetStatic(); } diff --git a/src/Monolog/Handler/GroupHandler.php b/src/Monolog/Handler/GroupHandler.php index 28b9f162..309d3be9 100644 --- a/src/Monolog/Handler/GroupHandler.php +++ b/src/Monolog/Handler/GroupHandler.php @@ -102,7 +102,7 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset } } - public function close() + public function close(): void { parent::close(); diff --git a/src/Monolog/Logger.php b/src/Monolog/Logger.php index 1c05293c..79b7d836 100644 --- a/src/Monolog/Logger.php +++ b/src/Monolog/Logger.php @@ -135,7 +135,7 @@ class Logger implements LoggerInterface, ResettableInterface protected $timezone; /** - * @var ?callable + * @var callable|null */ protected $exceptionHandler; @@ -343,7 +343,7 @@ class Logger implements LoggerInterface, ResettableInterface * This is useful at the end of a request and will be called automatically on every handler * when they get destructed. */ - public function close() + public function close(): void { foreach ($this->handlers as $handler) { $handler->close(); @@ -360,7 +360,7 @@ class Logger implements LoggerInterface, ResettableInterface * have a long running process like a worker or an application server serving multiple requests * in one process. */ - public function reset() + public function reset(): void { foreach ($this->handlers as $handler) { if ($handler instanceof ResettableInterface) {