Skip to content

Commit 06126f3

Browse files
authored
Merge pull request #2 from magento-commerce/ACP2E-3837
ACP2E-3837: DMT 2.4.8.1 Release
2 parents debc9bd + 605d38e commit 06126f3

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "magento/data-migration-tool",
33
"description": "Migration Tool",
4-
"version": "2.4.8",
4+
"version": "2.4.8.1",
55
"require": {
66
"symfony/console": "^6.4",
77
"magento/framework": "*",
8-
"monolog/monolog": "^2.3"
8+
"monolog/monolog": "^3.6"
99
},
1010
"require-dev": {
1111
"phpunit/phpunit": "~9.5.0"

src/Migration/Logger/ConsoleHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Monolog\Handler\HandlerInterface;
1111
use Monolog\Handler\AbstractHandler;
1212
use Psr\Log\LogLevel;
13+
use Monolog\LogRecord;
1314

1415
/**
1516
* Processing logger handler creation for migration application
@@ -46,7 +47,7 @@ protected function colorize($string, $color)
4647
/**
4748
* @inheritdoc
4849
*/
49-
public function handle(array $record): bool
50+
public function handle(LogRecord $record): bool
5051
{
5152
if (!$this->isHandling($record)) {
5253
return false;

src/Migration/Logger/FileHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\App\Filesystem\DirectoryList;
1111
use Monolog\Formatter\FormatterInterface;
1212
use Monolog\Handler\HandlerInterface;
13+
use Monolog\LogRecord;
1314

1415
/**
1516
* Processing logger handler creation for migration application
@@ -59,7 +60,7 @@ public function __construct(File $file, Config $config, \Magento\Framework\Files
5960
/**
6061
* @inheritdoc
6162
*/
62-
public function handle(array $record): bool
63+
public function handle(LogRecord $record): bool
6364
{
6465
if (!$this->isHandling($record)) {
6566
return false;

src/Migration/Logger/Logger.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
namespace Migration\Logger;
88

9-
use Monolog\DateTimeImmutable;
9+
use Monolog\JsonSerializableDateTimeImmutable;
10+
use Monolog\Level;
1011

1112
/**
1213
* Processing logger handler creation for migration application
@@ -33,10 +34,12 @@ public function __construct($name = 'Migration', array $handlers = [], array $pr
3334
/**
3435
* @inheritdoc
3536
*/
36-
public function addRecord(int $level, string $message, array $context = [], DateTimeImmutable $datetime = null): bool
37+
38+
public function addRecord(int|Level $level, string $message, array $context = [], JsonSerializableDateTimeImmutable|null $datetime = null): bool
3739
{
38-
$processed = parent::addRecord($level, $message, $context);
39-
self::$messages[$level][] = $message;
40+
$levelValue = $level instanceof Level ? $level->value : $level;
41+
$processed = parent::addRecord($levelValue, $message, $context);
42+
self::$messages[$levelValue][] = $message;
4043
return $processed;
4144
}
4245

src/Migration/Logger/MessageFormatter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Migration\Logger;
77

8+
use Monolog\LogRecord;
9+
810
/**
911
* Format logger messages corresponding to verbosity level
1012
*/
@@ -13,12 +15,12 @@ class MessageFormatter extends \Monolog\Formatter\LineFormatter implements \Mono
1315
/**
1416
* @inheritdoc
1517
*/
16-
protected $format;
18+
protected string $format;
1719

1820
/**
1921
* @inheritdoc
2022
*/
21-
public function format(array $record): string
23+
public function format(LogRecord $record): string
2224
{
2325
$this->format = $this->getLevelFormat($record['level_name']);
2426
return parent::format($record);

src/Migration/Logger/MessageProcessor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Migration\Logger;
77

8+
use Monolog\LogRecord;
9+
810
/**
911
* Logger messages processor
1012
*/
@@ -23,10 +25,10 @@ class MessageProcessor
2325
/**
2426
* Set extra
2527
*
26-
* @param array $record
28+
* @param LogRecord $record
2729
* @return array
2830
*/
29-
public function setExtra(array $record)
31+
public function setExtra(LogRecord $record)
3032
{
3133
foreach ($record['context'] as $key => $value) {
3234
switch ($key) {

0 commit comments

Comments
 (0)