From 2588f5fdb6111ebb5d1031d7a34dd35288bcde00 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Fri, 28 Jun 2024 14:31:12 +0200 Subject: [PATCH 01/15] Upgrade dependency modules --- composer.json | 58 ++++++++++++++----------- src/Loggers/Handlers/HandlerWrapper.php | 7 +-- src/Loggers/SerialProcessor.php | 8 ++-- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/composer.json b/composer.json index ed06e2e2..f9f9e6ad 100755 --- a/composer.json +++ b/composer.json @@ -3,36 +3,36 @@ "description": "A library supporting generic Magento 2 import functionality", "license": "MIT", "require": { - "php": ">=7.3.0", - "psr/log": "~1.0|~2.0|~3.0", - "psr/cache" : "~1.0|~2.0|~3.0", - "psr/container": "1.1.1", - "handcraftedinthealps/goodby-csv": "^1.4.0", - "monolog/monolog": "~1.0|~2.3", - "league/event": "~2.0", - "ramsey/uuid": "^3.7|^3.8|^4.1|^4.2", - "swiftmailer/swiftmailer": "^6.2.5", - "laminas/laminas-filter": "~2.0", - "techdivision/import-dbal": "^1.0.0", - "techdivision/import-dbal-collection": "^1.0.0", - "techdivision/import-cache": "^1.0.0", - "techdivision/import-cache-collection": "^1.0.0", - "techdivision/import-serializer": "^1.0.0", - "techdivision/import-serializer-csv": "^1.0.0", - "techdivision/import-configuration": "^5.0.0", + "php": "^8.1", + "psr/log": "^2.0.0", + "psr/cache" : "^2.0.0", + "psr/container": "^1.1.2", + "handcraftedinthealps/goodby-csv": "^1.1.2", + "monolog/monolog": "^3.6.0", + "league/event": "^2.2.0", + "ramsey/uuid": "^4.7.6", + "swiftmailer/swiftmailer": "v6.3.0", + "laminas/laminas-filter": "^2.36.0", + "techdivision/import-dbal": "*", + "techdivision/import-dbal-collection": "*", + "techdivision/import-cache": "*", + "techdivision/import-cache-collection": "*", + "techdivision/import-serializer": "*", + "techdivision/import-serializer-csv": "*", + "techdivision/import-configuration": "*", "ext-json": "*", "ext-zip": "*" }, "require-dev": { - "doctrine/dbal": "2.5.*", - "pdepend/pdepend": "2.5.2", - "phpmd/phpmd": "@stable", - "phpunit/phpunit": "^6.5.0|^8.0.0|~9.5.0", - "sebastian/phpcpd": "~3.0|~4.0|~5.0|~6.0", - "squizlabs/php_codesniffer": "~3.4.0|~3.6.0", - "consolidation/robo": "~1.0", - "mikey179/vfsstream": "~1.0", - "symfony/http-kernel": "~2.0|~3.0|~4.0" + "doctrine/dbal": "^4.0.4", + "pdepend/pdepend": "^2.16.2", + "phpmd/phpmd": "^2.15.0", + "phpunit/phpunit": "^11.2.5", + "sebastian/phpcpd": "^2.0.1", + "squizlabs/php_codesniffer": "^3.10.1", + "consolidation/robo": "^4.0.2", + "mikey179/vfsstream": "v1.6.11", + "symfony/http-kernel": "v4.4.51" }, "authors": [ { @@ -48,5 +48,11 @@ "tests/unit/" ] } + }, + "repositories": { + "repo.met.tdintern.de": { + "type": "path", + "url": "../*" + } } } diff --git a/src/Loggers/Handlers/HandlerWrapper.php b/src/Loggers/Handlers/HandlerWrapper.php index 54f1e4ad..119db0c1 100644 --- a/src/Loggers/Handlers/HandlerWrapper.php +++ b/src/Loggers/Handlers/HandlerWrapper.php @@ -16,6 +16,7 @@ use Monolog\Handler\HandlerInterface; use Monolog\Formatter\FormatterInterface; +use Monolog\LogRecord; use TechDivision\Import\Loggers\HandlerFactoryInterface; use TechDivision\Import\Configuration\Logger\HandlerConfigurationInterface; @@ -104,11 +105,11 @@ public function reset() * is no guarantee that handle() will not be called, and isHandling() might not be called * for a given record. * - * @param array $record Partial log record containing only a level key + * @param array|LogRecord $record Partial log record containing only a level key * * @return boolean TRUE if the handler has to handle the record, FALSE otherwise */ - public function isHandling(array $record): bool + public function isHandling(array|LogRecord $record): bool { return $this->handler->isHandling($record); } @@ -128,7 +129,7 @@ public function isHandling(array $record): bool * @return boolean TRUE means that this handler handled the record, and that bubbling is not permitted. * FALSE means the record was either not processed or that this handler allows bubbling. */ - public function handle(array $record): bool + public function handle(array|LogRecord $record): bool { return $this->handler->handle($record); } diff --git a/src/Loggers/SerialProcessor.php b/src/Loggers/SerialProcessor.php index b9f172b2..526ef817 100644 --- a/src/Loggers/SerialProcessor.php +++ b/src/Loggers/SerialProcessor.php @@ -14,6 +14,7 @@ namespace TechDivision\Import\Loggers; +use Monolog\LogRecord; use Monolog\Processor\ProcessorInterface; use TechDivision\Import\Configuration\ConfigurationInterface; @@ -49,12 +50,13 @@ public function __construct(ConfigurationInterface $configuration) /** * Will be invoked by the logger processor chain to append the serial. * - * @param array $record The record to append the serial to + * @param LogRecord $record The record to append the serial to * * @return array The record with the appended serial */ - public function __invoke(array $record) + public function __invoke(array|LogRecord $record) { - return array_merge($record, array('extra' => array('serial' => $this->serial))); + $record->extra = array('serial' => $this->serial); + return $record; } } From 2cc0a8edf062a08beebb6f73f6987ea0b33c5737 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Fri, 28 Jun 2024 14:32:25 +0200 Subject: [PATCH 02/15] update composer.json --- composer.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/composer.json b/composer.json index f9f9e6ad..73ba190d 100755 --- a/composer.json +++ b/composer.json @@ -48,11 +48,5 @@ "tests/unit/" ] } - }, - "repositories": { - "repo.met.tdintern.de": { - "type": "path", - "url": "../*" - } } } From c7a03b0ff6e717409fb32fee6b3c24c34eb3fa5f Mon Sep 17 00:00:00 2001 From: yamlahik Date: Mon, 1 Jul 2024 11:15:26 +0200 Subject: [PATCH 03/15] update composer.json --- composer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 73ba190d..8d1ef49b 100755 --- a/composer.json +++ b/composer.json @@ -13,13 +13,13 @@ "ramsey/uuid": "^4.7.6", "swiftmailer/swiftmailer": "v6.3.0", "laminas/laminas-filter": "^2.36.0", - "techdivision/import-dbal": "*", - "techdivision/import-dbal-collection": "*", - "techdivision/import-cache": "*", - "techdivision/import-cache-collection": "*", - "techdivision/import-serializer": "*", - "techdivision/import-serializer-csv": "*", - "techdivision/import-configuration": "*", + "techdivision/import-dbal": "dev-compatibility-php-81", + "techdivision/import-dbal-collection": "dev-compatibility-php-81", + "techdivision/import-cache": "dev-compatibility-php-81", + "techdivision/import-cache-collection": "dev-compatibility-php-81", + "techdivision/import-serializer": "dev-compatibility-php-81", + "techdivision/import-serializer-csv": "dev-compatibility-php-81", + "techdivision/import-configuration": "dev-compatibility-php-81", "ext-json": "*", "ext-zip": "*" }, From 3f33ea1fa5c63b821be645a0cf44670c51174e4e Mon Sep 17 00:00:00 2001 From: yamlahik Date: Mon, 1 Jul 2024 11:56:11 +0200 Subject: [PATCH 04/15] update composer.json --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index 8d1ef49b..243111c4 100755 --- a/composer.json +++ b/composer.json @@ -23,6 +23,8 @@ "ext-json": "*", "ext-zip": "*" }, + "minimum-stability": "dev", + "prefer-stable": true, "require-dev": { "doctrine/dbal": "^4.0.4", "pdepend/pdepend": "^2.16.2", From beffe4cf03bd25028ef4209fb38fb2713b0af3f3 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Mon, 1 Jul 2024 15:05:07 +0200 Subject: [PATCH 05/15] update composer.json --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 243111c4..23065818 100755 --- a/composer.json +++ b/composer.json @@ -4,11 +4,11 @@ "license": "MIT", "require": { "php": "^8.1", - "psr/log": "^2.0.0", - "psr/cache" : "^2.0.0", + "psr/log": "^2.0.0|^3.0.0", + "psr/cache" : "^2.0.0|^3.0.0", "psr/container": "^1.1.2", - "handcraftedinthealps/goodby-csv": "^1.1.2", - "monolog/monolog": "^3.6.0", + "handcraftedinthealps/goodby-csv": "^1.4.2", + "monolog/monolog": "^3.7.0", "league/event": "^2.2.0", "ramsey/uuid": "^4.7.6", "swiftmailer/swiftmailer": "v6.3.0", From 5f2d3dbaf6c18abdcf7f1982bce48259dce8ae24 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Tue, 2 Jul 2024 12:49:17 +0200 Subject: [PATCH 06/15] update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 23065818..8497c06b 100755 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "psr/cache" : "^2.0.0|^3.0.0", "psr/container": "^1.1.2", "handcraftedinthealps/goodby-csv": "^1.4.2", - "monolog/monolog": "^3.7.0", + "monolog/monolog": "^2.9|^3.7", "league/event": "^2.2.0", "ramsey/uuid": "^4.7.6", "swiftmailer/swiftmailer": "v6.3.0", From 8e63254b16f624b65b4fe74485f692a130fda115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Eisenfu=CC=88hrer?= Date: Tue, 9 Jul 2024 15:59:00 +0200 Subject: [PATCH 07/15] Fix monolog backward compatiility --- src/Loggers/SerialProcessor.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Loggers/SerialProcessor.php b/src/Loggers/SerialProcessor.php index 526ef817..336b5cb8 100644 --- a/src/Loggers/SerialProcessor.php +++ b/src/Loggers/SerialProcessor.php @@ -52,11 +52,14 @@ public function __construct(ConfigurationInterface $configuration) * * @param LogRecord $record The record to append the serial to * - * @return array The record with the appended serial + * @return array|LogRecord The record with the appended serial */ public function __invoke(array|LogRecord $record) { - $record->extra = array('serial' => $this->serial); - return $record; + if ($record instanceof LogRecord) { + $record->extra = array_merge($record->extra, array('serial' => $this->serial)); + return $record; + } + return array_merge($record, array('extra' => array('serial' => $this->serial))); } } From 97087cc0f3211a48cef98ab1bf06b512def1d559 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Wed, 17 Jul 2024 11:53:28 +0200 Subject: [PATCH 08/15] Pac-897: update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8497c06b..c8cdcc5e 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "handcraftedinthealps/goodby-csv": "^1.4.2", "monolog/monolog": "^2.9|^3.7", "league/event": "^2.2.0", - "ramsey/uuid": "^4.7.6", + "ramsey/uuid": "^4.2|^4.7", "swiftmailer/swiftmailer": "v6.3.0", "laminas/laminas-filter": "^2.36.0", "techdivision/import-dbal": "dev-compatibility-php-81", From 6fad826da4f536f7dc373106b86651fff3f4be7c Mon Sep 17 00:00:00 2001 From: yamlahik Date: Wed, 17 Jul 2024 13:30:18 +0200 Subject: [PATCH 09/15] Pac-897: update composer.json --- composer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/composer.json b/composer.json index c8cdcc5e..357fc4d2 100755 --- a/composer.json +++ b/composer.json @@ -23,6 +23,12 @@ "ext-json": "*", "ext-zip": "*" }, + "conflict": { + "laminas/laminas-servicemanager": "<3.21.0" + }, + "replace": { + "laminas/laminas-code": "4.5.2" + }, "minimum-stability": "dev", "prefer-stable": true, "require-dev": { From 5af7cdd264f8b2141cf79455758182de095bb03a Mon Sep 17 00:00:00 2001 From: yamlahik Date: Wed, 17 Jul 2024 14:06:12 +0200 Subject: [PATCH 10/15] Pac-897: update composer.json --- composer.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/composer.json b/composer.json index 357fc4d2..c8cdcc5e 100755 --- a/composer.json +++ b/composer.json @@ -23,12 +23,6 @@ "ext-json": "*", "ext-zip": "*" }, - "conflict": { - "laminas/laminas-servicemanager": "<3.21.0" - }, - "replace": { - "laminas/laminas-code": "4.5.2" - }, "minimum-stability": "dev", "prefer-stable": true, "require-dev": { From b5b6b2e8426e5554ee2429d2019c2d15e27e4704 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Wed, 17 Jul 2024 14:24:57 +0200 Subject: [PATCH 11/15] Pac-897: update composer.json --- composer.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/composer.json b/composer.json index c8cdcc5e..21b85a3b 100755 --- a/composer.json +++ b/composer.json @@ -23,6 +23,19 @@ "ext-json": "*", "ext-zip": "*" }, + "conflict": { + "laminas/laminas-servicemanager": [ + "3.11.1", + "3.12.0", + "3.13.0", + "3.15.0", + "3.17.0", + "3.20.0" + ] + }, + "replace": { + "laminas/laminas-code": "4.5.2" + }, "minimum-stability": "dev", "prefer-stable": true, "require-dev": { From f5ed8aa799e601614ff0d57a259b849d66b673d2 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Wed, 17 Jul 2024 18:23:48 +0200 Subject: [PATCH 12/15] Pac-897: update composer.json --- composer.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/composer.json b/composer.json index 21b85a3b..c8cdcc5e 100755 --- a/composer.json +++ b/composer.json @@ -23,19 +23,6 @@ "ext-json": "*", "ext-zip": "*" }, - "conflict": { - "laminas/laminas-servicemanager": [ - "3.11.1", - "3.12.0", - "3.13.0", - "3.15.0", - "3.17.0", - "3.20.0" - ] - }, - "replace": { - "laminas/laminas-code": "4.5.2" - }, "minimum-stability": "dev", "prefer-stable": true, "require-dev": { From b074ea66321fa1dcab91643820ad9c4abc76020f Mon Sep 17 00:00:00 2001 From: Martin <35043036+Mardl@users.noreply.github.com> Date: Thu, 18 Jul 2024 12:09:01 +0200 Subject: [PATCH 13/15] Update composer.json new min. laminas filter --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c8cdcc5e..a7477014 100755 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "league/event": "^2.2.0", "ramsey/uuid": "^4.2|^4.7", "swiftmailer/swiftmailer": "v6.3.0", - "laminas/laminas-filter": "^2.36.0", + "laminas/laminas-filter": "^2.31.0", "techdivision/import-dbal": "dev-compatibility-php-81", "techdivision/import-dbal-collection": "dev-compatibility-php-81", "techdivision/import-cache": "dev-compatibility-php-81", From dc32049c3a32f6709364b905cf54a57e38b2ffc3 Mon Sep 17 00:00:00 2001 From: yamlahik Date: Thu, 18 Jul 2024 13:56:01 +0200 Subject: [PATCH 14/15] Pac-897: update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a7477014..5fef1c1e 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": "MIT", "require": { "php": "^8.1", - "psr/log": "^2.0.0|^3.0.0", + "psr/log": "^1.0.0|^2.0.0|^3.0.0", "psr/cache" : "^2.0.0|^3.0.0", "psr/container": "^1.1.2", "handcraftedinthealps/goodby-csv": "^1.4.2", From b6222043831d90c988968bc6053a63773e8eb8ff Mon Sep 17 00:00:00 2001 From: yamlahik Date: Wed, 24 Jul 2024 14:11:27 +0200 Subject: [PATCH 15/15] UPDATE composer.json & changelog --- CHANGELOG.md | 9 +++++++++ composer.json | 20 +++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad2c5d3a..e8d6bc19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# Version 18.0.0 + +### PHP 8.1 Compatibility + +* Update dependencies +* Add PHP ">=8.1" support +* Remove PHP 7.3 support +* Fix compatiility import logger with monolog/monolog + # Version 17.8.3 ## Bugfixes diff --git a/composer.json b/composer.json index 5fef1c1e..9d835feb 100755 --- a/composer.json +++ b/composer.json @@ -13,18 +13,16 @@ "ramsey/uuid": "^4.2|^4.7", "swiftmailer/swiftmailer": "v6.3.0", "laminas/laminas-filter": "^2.31.0", - "techdivision/import-dbal": "dev-compatibility-php-81", - "techdivision/import-dbal-collection": "dev-compatibility-php-81", - "techdivision/import-cache": "dev-compatibility-php-81", - "techdivision/import-cache-collection": "dev-compatibility-php-81", - "techdivision/import-serializer": "dev-compatibility-php-81", - "techdivision/import-serializer-csv": "dev-compatibility-php-81", - "techdivision/import-configuration": "dev-compatibility-php-81", + "techdivision/import-dbal": "^2.0.0", + "techdivision/import-dbal-collection": "^2.0.0", + "techdivision/import-cache": "^2.0.0", + "techdivision/import-cache-collection": "^2.0.0", + "techdivision/import-serializer": "^2.0.0", + "techdivision/import-serializer-csv": "^2.0.0", + "techdivision/import-configuration": "^6.0.0.", "ext-json": "*", "ext-zip": "*" }, - "minimum-stability": "dev", - "prefer-stable": true, "require-dev": { "doctrine/dbal": "^4.0.4", "pdepend/pdepend": "^2.16.2", @@ -33,8 +31,8 @@ "sebastian/phpcpd": "^2.0.1", "squizlabs/php_codesniffer": "^3.10.1", "consolidation/robo": "^4.0.2", - "mikey179/vfsstream": "v1.6.11", - "symfony/http-kernel": "v4.4.51" + "mikey179/vfsstream": "~1.6.11", + "symfony/http-kernel": "~4.4.51" }, "authors": [ {