Skip to content

Commit

Permalink
bug #36338 [5.0][MonologBridge] Fix $level type (fancyweb)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.0 branch.

Discussion
----------

[5.0][MonologBridge] Fix $level type

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36334 (comment)
| License       | MIT
| Doc PR        | -

Commits
-------

d9c0681 [5.0][MonologBridge] Fix $level type
  • Loading branch information
fabpot committed Apr 4, 2020
2 parents e1a522b + d9c0681 commit e0c1ee6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Symfony/Bridge/Monolog/Handler/NotifierHandler.php
Expand Up @@ -26,11 +26,14 @@ class NotifierHandler extends AbstractHandler
{
private $notifier;

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

parent::__construct($level < Logger::ERROR ? Logger::ERROR : $level, $bubble);
parent::__construct(Logger::toMonologLevel($level) < Logger::ERROR ? Logger::ERROR : $level, $bubble);
}

public function handle(array $record): bool
Expand Down
5 changes: 4 additions & 1 deletion src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php
Expand Up @@ -54,7 +54,10 @@ trait ServerLogHandlerTrait
private $context;
private $socket;

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

Expand Down

0 comments on commit e0c1ee6

Please sign in to comment.