8000 [5.0][MonologBridge] Fix $level type · symfony/symfony@d9c0681 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9c0681

Browse files
committed
[5.0][MonologBridge] Fix $level type
1 parent e1a522b commit d9c0681

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/Symfony/Bridge/Monolog/Handler/NotifierHandler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ class NotifierHandler extends AbstractHandler
2626
{
2727
private $notifier;
2828

29-
public function __construct(NotifierInterface $notifier, int $level = Logger::ERROR, bool $bubble = true)
29+
/**
30+
* @param string|int $level The minimum logging level at which this handler will be triggered
31+
*/
32+
public function __construct(NotifierInterface $notifier, $level = Logger::ERROR, bool $bubble = true)
3033
{
3134
$this->notifier = $notifier;
3235

33-
parent::__construct($level < Logger::ERROR ? Logger::ERROR : $level, $bubble);
36+
parent::__construct(Logger::toMonologLevel($level) < Logger::ERROR ? Logger::ERROR : $level, $bubble);
3437
}
3538

3639
public function handle(array $record): bool

src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ trait ServerLogHandlerTrait
5454
private $context;
5555
private $socket;
5656

57-
public function __construct(string $host, int $level = Logger::DEBUG, bool $bubble = true, array $context = [])
57+
/**
58+
* @param string|int $level The minimum logging level at which this handler will be triggered
59+
*/
60+
public function __construct(string $host, $level = Logger::DEBUG, bool $bubble = true, array $context = [])
5861
{
5962
parent::__construct($level, $bubble);
6063

0 commit comments

Comments
 (0)
0