Просмотр исходного кода

Merge pull request #1478 from gmponos/patch-2

 Allow int or string on handlers as level
Jordi Boggiano 5 лет назад
Родитель
Сommit
62700a29cc

+ 2 - 2
src/Monolog/Handler/OverflowHandler.php

@@ -61,13 +61,13 @@ class OverflowHandler extends AbstractHandler implements FormattableHandlerInter
     /**
      * @param HandlerInterface $handler
      * @param int[]            $thresholdMap Dictionary of logger level => threshold
-     * @param int              $level
+     * @param int|string       $level        The minimum logging level at which this handler will be triggered
      * @param bool             $bubble
      */
     public function __construct(
         HandlerInterface $handler,
         array $thresholdMap = [],
-        int $level = Logger::DEBUG,
+        $level = Logger::DEBUG,
         bool $bubble = true
     ) {
         $this->handler = $handler;

+ 2 - 2
src/Monolog/Handler/SendGridHandler.php

@@ -56,10 +56,10 @@ class SendGridHandler extends MailHandler
      * @param string       $from    The sender of the email
      * @param string|array $to      The recipients of the email
      * @param string       $subject The subject of the mail
-     * @param int          $level   The minimum logging level at which this handler will be triggered
+     * @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, int $level = Logger::ERROR, bool $bubble = true)
+    public function __construct(string $apiUser, string $apiKey, string $from, $to, string $subject, $level = Logger::ERROR, bool $bubble = true)
     {
         parent::__construct($level, $bubble);
         $this->apiUser = $apiUser;