summaryrefslogtreecommitdiffstats
path: root/src/Monolog/Handler/NullHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Monolog/Handler/NullHandler.php')
-rw-r--r--src/Monolog/Handler/NullHandler.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Monolog/Handler/NullHandler.php b/src/Monolog/Handler/NullHandler.php
index 4b84588..93678e8 100644
--- a/src/Monolog/Handler/NullHandler.php
+++ b/src/Monolog/Handler/NullHandler.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
@@ -21,20 +21,30 @@ use Monolog\Logger;
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
-class NullHandler extends AbstractHandler
+class NullHandler extends Handler
{
+ private $level;
+
/**
* @param int $level The minimum logging level at which this handler will be triggered
*/
- public function __construct($level = Logger::DEBUG)
+ public function __construct(int $level = Logger::DEBUG)
+ {
+ $this->level = $level;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function isHandling(array $record): bool
{
- parent::__construct($level, false);
+ return $record['level'] >= $this->level;
}
/**
* {@inheritdoc}
*/
- public function handle(array $record)
+ public function handle(array $record): bool
{
if ($record['level'] < $this->level) {
return false;