Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72bbf66

Browse files
committed
Fix test errors on Monolog 1
1 parent 7e81ede commit 72bbf66

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function handleBatch(array $records): void
4646
$messages = [];
4747

4848
if (Logger::API >= 3) {
49+
/** @var LogRecord $record */
4950
foreach ($records as $record) {
5051
if ($record->level->isLowerThan($this->level)) {
5152
continue;

src/Symfony/Bridge/Monolog/Tests/Handler/ElasticsearchLogstashHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testHandle()
5757
$this->assertSame(1, $callCount);
5858
}
5959

60-
public function testBandleBatch()
60+
public function testHandleBatch()
6161
{
6262
$callCount = 0;
6363
$responseFactory = function ($method, $url, $options) use (&$callCount) {

src/Symfony/Bridge/Monolog/Tests/RecordFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ public static function create(int|string $level = 'warning', string|\Stringable
3737
'level' => $level,
3838
'level_name' => Logger::getLevelName($level),
3939
'channel' => $channel,
40-
'datetime' => $datetime,
40+
// Monolog 1 had no support for DateTimeImmutable
41+
'datetime' => Logger::API >= 2 ? $datetime : \DateTime::createFromImmutable($datetime),
4142
'extra' => $extra,
4243
];
4344
}

0 commit comments

Comments
 (0)