diff --git a/src/Monolog/Handler/AbstractHandler.php b/src/Monolog/Handler/AbstractHandler.php index 6d0fdae2..1f467951 100644 --- a/src/Monolog/Handler/AbstractHandler.php +++ b/src/Monolog/Handler/AbstractHandler.php @@ -13,6 +13,7 @@ namespace Monolog\Handler; use Monolog\Logger; use Monolog\ResettableInterface; +use Psr\Log\LogLevel; /** * Base Handler class providing basic level/bubble support @@ -20,6 +21,7 @@ use Monolog\ResettableInterface; * @author Jordi Boggiano * * @phpstan-import-type Level from \Monolog\Logger + * @phpstan-import-type LevelName from \Monolog\Logger */ abstract class AbstractHandler extends Handler implements ResettableInterface { @@ -34,6 +36,8 @@ abstract class AbstractHandler extends Handler implements ResettableInterface /** * @param int|string $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 + * + * @phpstan-param Level|LevelName|LogLevel::* $level */ public function __construct($level = Logger::DEBUG, bool $bubble = true) { @@ -52,7 +56,7 @@ abstract class AbstractHandler extends Handler implements ResettableInterface /** * Sets minimum logging level at which this handler will be triggered. * - * @param int|string $level Level or level name + * @param Level|LevelName|LogLevel::* $level Level or level name * @return self */ public function setLevel($level): self diff --git a/src/Monolog/Handler/AbstractSyslogHandler.php b/src/Monolog/Handler/AbstractSyslogHandler.php index 55a3384d..673561ab 100644 --- a/src/Monolog/Handler/AbstractSyslogHandler.php +++ b/src/Monolog/Handler/AbstractSyslogHandler.php @@ -61,8 +61,6 @@ abstract class AbstractSyslogHandler extends AbstractProcessingHandler /** * @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant - * @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($facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/AmqpHandler.php b/src/Monolog/Handler/AmqpHandler.php index d91f1b68..ea7f5d3f 100644 --- a/src/Monolog/Handler/AmqpHandler.php +++ b/src/Monolog/Handler/AmqpHandler.php @@ -36,8 +36,6 @@ class AmqpHandler extends AbstractProcessingHandler /** * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use * @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) { diff --git a/src/Monolog/Handler/BufferHandler.php b/src/Monolog/Handler/BufferHandler.php index 874fd0d9..e4b46a97 100644 --- a/src/Monolog/Handler/BufferHandler.php +++ b/src/Monolog/Handler/BufferHandler.php @@ -45,8 +45,6 @@ class BufferHandler extends AbstractHandler implements ProcessableHandlerInterfa /** * @param HandlerInterface $handler Handler. * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @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 * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded */ public function __construct(HandlerInterface $handler, int $bufferLimit = 0, $level = Logger::DEBUG, bool $bubble = true, bool $flushOnOverflow = false) diff --git a/src/Monolog/Handler/ChromePHPHandler.php b/src/Monolog/Handler/ChromePHPHandler.php index d9b58767..27214665 100644 --- a/src/Monolog/Handler/ChromePHPHandler.php +++ b/src/Monolog/Handler/ChromePHPHandler.php @@ -64,10 +64,6 @@ class ChromePHPHandler extends AbstractProcessingHandler /** @var bool */ protected static $sendHeaders = true; - /** - * @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($level = Logger::DEBUG, bool $bubble = true) { parent::__construct($level, $bubble); diff --git a/src/Monolog/Handler/DynamoDbHandler.php b/src/Monolog/Handler/DynamoDbHandler.php index 9948ef19..9973fc3b 100644 --- a/src/Monolog/Handler/DynamoDbHandler.php +++ b/src/Monolog/Handler/DynamoDbHandler.php @@ -48,9 +48,6 @@ class DynamoDbHandler extends AbstractProcessingHandler */ protected $marshaler; - /** - * @param int|string $level - */ public function __construct(DynamoDbClient $client, string $table, $level = Logger::DEBUG, bool $bubble = true) { /** @phpstan-ignore-next-line */ diff --git a/src/Monolog/Handler/ElasticaHandler.php b/src/Monolog/Handler/ElasticaHandler.php index 3c6f8795..26f2187c 100644 --- a/src/Monolog/Handler/ElasticaHandler.php +++ b/src/Monolog/Handler/ElasticaHandler.php @@ -49,8 +49,6 @@ class ElasticaHandler extends AbstractProcessingHandler /** * @param Client $client Elastica Client object * @param mixed[] $options Handler configuration - * @param int|string $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(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/ElasticsearchHandler.php b/src/Monolog/Handler/ElasticsearchHandler.php index fddcc5be..44787dbe 100644 --- a/src/Monolog/Handler/ElasticsearchHandler.php +++ b/src/Monolog/Handler/ElasticsearchHandler.php @@ -56,8 +56,6 @@ class ElasticsearchHandler extends AbstractProcessingHandler /** * @param Client $client Elasticsearch Client object * @param mixed[] $options Handler configuration - * @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(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/ErrorLogHandler.php b/src/Monolog/Handler/ErrorLogHandler.php index fb0ebf2f..5b75b000 100644 --- a/src/Monolog/Handler/ErrorLogHandler.php +++ b/src/Monolog/Handler/ErrorLogHandler.php @@ -32,8 +32,6 @@ class ErrorLogHandler extends AbstractProcessingHandler /** * @param int $messageType Says where the error should go. - * @param int|string $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 * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries */ public function __construct(int $messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, bool $bubble = true, bool $expandNewlines = false) diff --git a/src/Monolog/Handler/GelfHandler.php b/src/Monolog/Handler/GelfHandler.php index d6965fa7..5a4c8ac9 100644 --- a/src/Monolog/Handler/GelfHandler.php +++ b/src/Monolog/Handler/GelfHandler.php @@ -31,8 +31,6 @@ class GelfHandler extends AbstractProcessingHandler /** * @param PublisherInterface $publisher a publisher object - * @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(PublisherInterface $publisher, $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/IFTTTHandler.php b/src/Monolog/Handler/IFTTTHandler.php index c8ed6ff7..502f8c3c 100644 --- a/src/Monolog/Handler/IFTTTHandler.php +++ b/src/Monolog/Handler/IFTTTHandler.php @@ -35,8 +35,6 @@ class IFTTTHandler extends AbstractProcessingHandler /** * @param string $eventName The name of the IFTTT Maker event that should be triggered * @param string $secretKey A valid IFTTT secret key - * @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(string $eventName, string $secretKey, $level = Logger::ERROR, bool $bubble = true) { diff --git a/src/Monolog/Handler/LogglyHandler.php b/src/Monolog/Handler/LogglyHandler.php index cd110bf7..27ab9dc0 100644 --- a/src/Monolog/Handler/LogglyHandler.php +++ b/src/Monolog/Handler/LogglyHandler.php @@ -45,8 +45,6 @@ class LogglyHandler extends AbstractProcessingHandler /** * @param string $token API token supplied by Loggly - * @param string|int $level The minimum logging level to trigger this handler - * @param bool $bubble Whether or not messages that are handled should bubble up the stack. * * @throws MissingExtensionException If the curl extension is missing */ diff --git a/src/Monolog/Handler/MandrillHandler.php b/src/Monolog/Handler/MandrillHandler.php index 95c612a8..f49dc1c4 100644 --- a/src/Monolog/Handler/MandrillHandler.php +++ b/src/Monolog/Handler/MandrillHandler.php @@ -32,8 +32,6 @@ class MandrillHandler extends MailHandler * * @param string $apiKey A valid Mandrill API key * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced - * @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(string $apiKey, $message, $level = Logger::ERROR, bool $bubble = true) { diff --git a/src/Monolog/Handler/MongoDBHandler.php b/src/Monolog/Handler/MongoDBHandler.php index 477bcd64..30630911 100644 --- a/src/Monolog/Handler/MongoDBHandler.php +++ b/src/Monolog/Handler/MongoDBHandler.php @@ -46,8 +46,6 @@ class MongoDBHandler extends AbstractProcessingHandler * @param Client|Manager $mongodb MongoDB library or driver client * @param string $database Database name * @param string $collection Collection name - * @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($mongodb, string $database, string $collection, $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/NativeMailerHandler.php b/src/Monolog/Handler/NativeMailerHandler.php index c2ef64e6..6f2f965b 100644 --- a/src/Monolog/Handler/NativeMailerHandler.php +++ b/src/Monolog/Handler/NativeMailerHandler.php @@ -68,8 +68,6 @@ class NativeMailerHandler extends MailHandler * @param string|string[] $to The receiver of the mail * @param string $subject The subject of the mail * @param string $from The sender of the mail - * @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 * @param int $maxColumnWidth The maximum column width that the message lines will have */ public function __construct($to, string $subject, string $from, $level = Logger::ERROR, bool $bubble = true, int $maxColumnWidth = 70) diff --git a/src/Monolog/Handler/NewRelicHandler.php b/src/Monolog/Handler/NewRelicHandler.php index 25df5427..114d749e 100644 --- a/src/Monolog/Handler/NewRelicHandler.php +++ b/src/Monolog/Handler/NewRelicHandler.php @@ -52,8 +52,6 @@ class NewRelicHandler extends AbstractProcessingHandler /** * {@inheritDoc} * - * @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. * @param string|null $appName * @param bool $explodeArrays * @param string|null $transactionName diff --git a/src/Monolog/Handler/NullHandler.php b/src/Monolog/Handler/NullHandler.php index 1f0078ac..482e7f68 100644 --- a/src/Monolog/Handler/NullHandler.php +++ b/src/Monolog/Handler/NullHandler.php @@ -12,6 +12,7 @@ namespace Monolog\Handler; use Monolog\Logger; +use Psr\Log\LogLevel; /** * Blackhole @@ -20,6 +21,9 @@ use Monolog\Logger; * to put on top of an existing stack to override it temporarily. * * @author Jordi Boggiano + * + * @phpstan-import-type Level from \Monolog\Logger + * @phpstan-import-type LevelName from \Monolog\Logger */ class NullHandler extends Handler { @@ -30,6 +34,8 @@ class NullHandler extends Handler /** * @param string|int $level The minimum logging level at which this handler will be triggered + * + * @phpstan-param Level|LevelName|LogLevel::* $level */ public function __construct($level = Logger::DEBUG) { diff --git a/src/Monolog/Handler/OverflowHandler.php b/src/Monolog/Handler/OverflowHandler.php index 04760749..77bd618a 100644 --- a/src/Monolog/Handler/OverflowHandler.php +++ b/src/Monolog/Handler/OverflowHandler.php @@ -61,8 +61,6 @@ class OverflowHandler extends AbstractHandler implements FormattableHandlerInter /** * @param HandlerInterface $handler * @param int[] $thresholdMap Dictionary of logger level => threshold - * @param int|string $level The minimum logging level at which this handler will be triggered - * @param bool $bubble */ public function __construct( HandlerInterface $handler, diff --git a/src/Monolog/Handler/PHPConsoleHandler.php b/src/Monolog/Handler/PHPConsoleHandler.php index d596c046..16edf101 100644 --- a/src/Monolog/Handler/PHPConsoleHandler.php +++ b/src/Monolog/Handler/PHPConsoleHandler.php @@ -72,8 +72,6 @@ class PHPConsoleHandler extends AbstractProcessingHandler /** * @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional) - * @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. * @throws \RuntimeException */ public function __construct(array $options = [], ?Connector $connector = null, $level = Logger::DEBUG, bool $bubble = true) diff --git a/src/Monolog/Handler/ProcessHandler.php b/src/Monolog/Handler/ProcessHandler.php index 97549949..d057efae 100644 --- a/src/Monolog/Handler/ProcessHandler.php +++ b/src/Monolog/Handler/ProcessHandler.php @@ -60,8 +60,6 @@ class ProcessHandler extends AbstractProcessingHandler /** * @param string $command Command for the process to start. Absolute paths are recommended, * especially if you do not use the $cwd parameter. - * @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. * @param string|null $cwd "Current working directory" (CWD) for the process to be executed in. * @throws \InvalidArgumentException */ diff --git a/src/Monolog/Handler/PsrHandler.php b/src/Monolog/Handler/PsrHandler.php index cba96a55..36e19ccc 100644 --- a/src/Monolog/Handler/PsrHandler.php +++ b/src/Monolog/Handler/PsrHandler.php @@ -40,8 +40,6 @@ class PsrHandler extends AbstractHandler implements FormattableHandlerInterface /** * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied - * @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(LoggerInterface $logger, $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/RedisHandler.php b/src/Monolog/Handler/RedisHandler.php index 02ee1c14..938eee6b 100644 --- a/src/Monolog/Handler/RedisHandler.php +++ b/src/Monolog/Handler/RedisHandler.php @@ -40,8 +40,6 @@ class RedisHandler extends AbstractProcessingHandler /** * @param \Predis\Client|\Redis $redis The redis instance * @param string $key The key name to push records to - * @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 * @param int $capSize Number of entries to limit list size to, 0 = unlimited */ public function __construct($redis, string $key, $level = Logger::DEBUG, bool $bubble = true, int $capSize = 0) diff --git a/src/Monolog/Handler/RedisPubSubHandler.php b/src/Monolog/Handler/RedisPubSubHandler.php index f6db4803..45218b30 100644 --- a/src/Monolog/Handler/RedisPubSubHandler.php +++ b/src/Monolog/Handler/RedisPubSubHandler.php @@ -36,8 +36,6 @@ class RedisPubSubHandler extends AbstractProcessingHandler /** * @param \Predis\Client|\Redis $redis The redis instance * @param string $key The channel key to publish records to - * @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($redis, string $key, $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/RollbarHandler.php b/src/Monolog/Handler/RollbarHandler.php index fdc4abb9..2d94da42 100644 --- a/src/Monolog/Handler/RollbarHandler.php +++ b/src/Monolog/Handler/RollbarHandler.php @@ -62,8 +62,6 @@ class RollbarHandler extends AbstractProcessingHandler /** * @param RollbarLogger $rollbarLogger RollbarLogger object constructed with valid token - * @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(RollbarLogger $rollbarLogger, $level = Logger::ERROR, bool $bubble = true) { diff --git a/src/Monolog/Handler/SendGridHandler.php b/src/Monolog/Handler/SendGridHandler.php index 3dcf9155..02ccc4fe 100644 --- a/src/Monolog/Handler/SendGridHandler.php +++ b/src/Monolog/Handler/SendGridHandler.php @@ -56,8 +56,6 @@ class SendGridHandler extends MailHandler * @param string $from The sender of the email * @param string|string[] $to The recipients of the email * @param string $subject The subject of the mail - * @param int|string $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(string $apiUser, string $apiKey, string $from, $to, string $subject, $level = Logger::ERROR, bool $bubble = true) { diff --git a/src/Monolog/Handler/SlackHandler.php b/src/Monolog/Handler/SlackHandler.php index 67e97474..13ad8b71 100644 --- a/src/Monolog/Handler/SlackHandler.php +++ b/src/Monolog/Handler/SlackHandler.php @@ -44,8 +44,6 @@ class SlackHandler extends SocketHandler * @param string|null $username Name of a bot * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) * @param string|null $iconEmoji The emoji name to use (or null) - * @param 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 * @param bool $useShortAttachment Whether the context/extra messages added to Slack as attachments are in a short style * @param bool $includeContextAndExtra Whether the attachment should include context and extra data * @param string[] $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] diff --git a/src/Monolog/Handler/SlackWebhookHandler.php b/src/Monolog/Handler/SlackWebhookHandler.php index 33ac1387..1c934774 100644 --- a/src/Monolog/Handler/SlackWebhookHandler.php +++ b/src/Monolog/Handler/SlackWebhookHandler.php @@ -44,8 +44,6 @@ class SlackWebhookHandler extends AbstractProcessingHandler * @param string|null $iconEmoji The emoji name to use (or null) * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style * @param bool $includeContextAndExtra Whether the attachment should include context and extra data - * @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 * @param string[] $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] */ public function __construct( diff --git a/src/Monolog/Handler/SocketHandler.php b/src/Monolog/Handler/SocketHandler.php index 4a1d7bf1..e35cac92 100644 --- a/src/Monolog/Handler/SocketHandler.php +++ b/src/Monolog/Handler/SocketHandler.php @@ -48,9 +48,7 @@ class SocketHandler extends AbstractProcessingHandler private $lastWritingAt = null; /** - * @param string $connectionString Socket connection string - * @param int|string $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 + * @param string $connectionString Socket connection string */ public function __construct(string $connectionString, $level = Logger::DEBUG, bool $bubble = true) { diff --git a/src/Monolog/Handler/StreamHandler.php b/src/Monolog/Handler/StreamHandler.php index 4ef049f3..51eb0268 100644 --- a/src/Monolog/Handler/StreamHandler.php +++ b/src/Monolog/Handler/StreamHandler.php @@ -42,8 +42,6 @@ class StreamHandler extends AbstractProcessingHandler /** * @param resource|string $stream If a missing path can't be created, an UnexpectedValueException will be thrown on first write - * @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 * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) * @param bool $useLocking Try to lock log file before doing any writes * diff --git a/src/Monolog/Handler/SwiftMailerHandler.php b/src/Monolog/Handler/SwiftMailerHandler.php index aa2181b2..e0e182db 100644 --- a/src/Monolog/Handler/SwiftMailerHandler.php +++ b/src/Monolog/Handler/SwiftMailerHandler.php @@ -36,8 +36,6 @@ class SwiftMailerHandler extends MailHandler * * @param \Swift_Mailer $mailer The mailer to use * @param callable|Swift_Message $message An example message for real messages, only the body will be replaced - * @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(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, bool $bubble = true) { diff --git a/src/Monolog/Handler/TelegramBotHandler.php b/src/Monolog/Handler/TelegramBotHandler.php index 9ea79a97..78774ce8 100644 --- a/src/Monolog/Handler/TelegramBotHandler.php +++ b/src/Monolog/Handler/TelegramBotHandler.php @@ -78,7 +78,6 @@ class TelegramBotHandler extends AbstractProcessingHandler /** * @param string $apiKey Telegram bot access token provided by BotFather * @param string $channel Telegram channel name - * @inheritDoc */ public function __construct( string $apiKey, diff --git a/src/Monolog/Handler/ZendMonitorHandler.php b/src/Monolog/Handler/ZendMonitorHandler.php index dc99f8f0..7c9577ca 100644 --- a/src/Monolog/Handler/ZendMonitorHandler.php +++ b/src/Monolog/Handler/ZendMonitorHandler.php @@ -33,8 +33,6 @@ class ZendMonitorHandler extends AbstractProcessingHandler protected $levelMap = []; /** - * @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. * @throws MissingExtensionException */ public function __construct($level = Logger::DEBUG, bool $bubble = true) diff --git a/src/Monolog/Processor/MercurialProcessor.php b/src/Monolog/Processor/MercurialProcessor.php index 9aeb3e3a..d4a628f5 100644 --- a/src/Monolog/Processor/MercurialProcessor.php +++ b/src/Monolog/Processor/MercurialProcessor.php @@ -12,21 +12,27 @@ namespace Monolog\Processor; use Monolog\Logger; +use Psr\Log\LogLevel; /** * Injects Hg branch and Hg revision number in all records * * @author Jonathan A. Schweder + * + * @phpstan-import-type LevelName from \Monolog\Logger + * @phpstan-import-type Level from \Monolog\Logger */ class MercurialProcessor implements ProcessorInterface { - /** @var int */ + /** @var Level */ private $level; /** @var array{branch: string, revision: string}|array|null */ private static $cache = null; /** - * @param string|int $level The minimum logging level at which this Processor will be triggered + * @param int|string $level The minimum logging level at which this Processor will be triggered + * + * @phpstan-param Level|LevelName|LogLevel::* $level */ public function __construct($level = Logger::DEBUG) { diff --git a/src/Monolog/SignalHandler.php b/src/Monolog/SignalHandler.php index 62f45e39..b1fafc01 100644 --- a/src/Monolog/SignalHandler.php +++ b/src/Monolog/SignalHandler.php @@ -19,13 +19,16 @@ use ReflectionExtension; * Monolog POSIX signal handler * * @author Robert Gust-Bardon + * + * @phpstan-import-type Level from \Monolog\Logger + * @phpstan-import-type LevelName from \Monolog\Logger */ class SignalHandler { /** @var LoggerInterface */ private $logger; - /** @var array SIG_DFL, SIG_IGN or previous callable */ + /** @var array SIG_DFL, SIG_IGN or previous callable */ private $previousSignalHandler = []; /** @var array */ private $signalLevelMap = []; @@ -43,6 +46,8 @@ class SignalHandler * @param bool $restartSyscalls * @param bool|null $async * @return $this + * + * @phpstan-param Level|LevelName|LogLevel::* $level */ public function registerSignalHandler(int $signo, $level = LogLevel::CRITICAL, bool $callPrevious = true, bool $restartSyscalls = true, ?bool $async = true): self {