Skip to content

Commit 0f05439

Browse files
committed
Monolog 2 compatibility.
1 parent 8fb4741 commit 0f05439

File tree

11 files changed

+16
-14
lines changed

11 files changed

+16
-14
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"doctrine/reflection": "~1.0",
109109
"doctrine/doctrine-bundle": "^1.5|^2.0",
110110
"masterminds/html5": "^2.6",
111-
"monolog/monolog": "~1.11",
111+
"monolog/monolog": "~1.11 || ^2",
112112
"nyholm/psr7": "^1.0",
113113
"ocramius/proxy-manager": "^2.1",
114114
"php-http/httplug": "^1.0|^2.0",

src/Symfony/Bridge/Monolog/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* The methods `DebugProcessor::getLogs()`, `DebugProcessor::countErrors()`, `Logger::getLogs()` and `Logger::countErrors()` have a new `$request` argument.
8+
* Added support for Monolog 2.
89

910
4.4.0
1011
-----

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function onKernelResponse(ResponseEvent $event)
5757
/**
5858
* {@inheritdoc}
5959
*/
60-
protected function sendHeader($header, $content)
60+
protected function sendHeader($header, $content): void
6161
{
6262
if (!$this->sendHeaders) {
6363
return;

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Monolog\Handler;
1313

14+
use Monolog\Formatter\FormatterInterface;
1415
use Monolog\Formatter\LineFormatter;
1516
use Monolog\Handler\AbstractProcessingHandler;
1617
use Monolog\Logger;
@@ -74,15 +75,15 @@ public function __construct(OutputInterface $output = null, bool $bubble = true,
7475
/**
7576
* {@inheritdoc}
7677
*/
77-
public function isHandling(array $record)
78+
public function isHandling(array $record): bool
7879
{
7980
return $this->updateLevel() && parent::isHandling($record);
8081
}
8182

8283
/**
8384
* {@inheritdoc}
8485
*/
85-
public function handle(array $record)
86+
public function handle(array $record): bool
8687
{
8788
// we have to update the logging level each time because the verbosity of the
8889
// console output might have changed in the meantime (it is not immutable)
@@ -100,7 +101,7 @@ public function setOutput(OutputInterface $output)
100101
/**
101102
* Disables the output.
102103
*/
103-
public function close()
104+
public function close(): void
104105
{
105106
$this->output = null;
106107

@@ -143,7 +144,7 @@ public static function getSubscribedEvents()
143144
/**
144145
* {@inheritdoc}
145146
*/
146-
protected function write(array $record)
147+
protected function write(array $record): void
147148
{
148149
// at this point we've determined for sure that we want to output the record, so use the output's own verbosity
149150
$this->output->write((string) $record['formatted'], false, $this->output->getVerbosity());
@@ -152,7 +153,7 @@ protected function write(array $record)
152153
/**
153154
* {@inheritdoc}
154155
*/
155-
protected function getDefaultFormatter()
156+
protected function getDefaultFormatter(): FormatterInterface
156157
{
157158
if (!class_exists(CliDumper::class)) {
158159
return new LineFormatter();

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(RequestStack $requestStack, array $exclusions, $acti
4545
$this->exclusions = $exclusions;
4646
}
4747

48-
public function isHandlerActivated(array $record)
48+
public function isHandlerActivated(array $record): bool
4949
{
5050
$isActivated = parent::isHandlerActivated($record);
5151

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/NotFoundActivationStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(RequestStack $requestStack, array $excludedUrls, $ac
3434
$this->blacklist = '{('.implode('|', $excludedUrls).')}i';
3535
}
3636

37-
public function isHandlerActivated(array $record)
37+
public function isHandlerActivated(array $record): bool
3838
{
3939
$isActivated = parent::isHandlerActivated($record);
4040

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function onKernelResponse(ResponseEvent $event)
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
protected function sendHeader($header, $content)
62+
protected function sendHeader($header, $content): void
6363
{
6464
if (!self::$sendHeaders) {
6565
return;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(string $host, int $level = Logger::DEBUG, bool $bubb
3939
/**
4040
* {@inheritdoc}
4141
*/
42-
public function handle(array $record)
42+
public function handle(array $record): bool
4343
{
4444
if (!$this->isHandling($record)) {
4545
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function onCliTerminate(ConsoleTerminateEvent $event)
5252
/**
5353
* {@inheritdoc}
5454
*/
55-
protected function send($content, array $records)
55+
protected function send($content, array $records): void
5656
{
5757
parent::send($content, $records);
5858

src/Symfony/Bridge/Monolog/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function clear()
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
public function reset()
62+
public function reset(): void
6363
{
6464
$this->clear();
6565

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy