From 1a1d7f00c778784754fed367cd35b32e34fb69ad Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Thu, 7 Nov 2024 15:59:25 +0200 Subject: [PATCH 01/38] Updated dependencies to be compatible with php 8.1 --- composer.json | 14 +- composer.lock | 3904 ++++++++++++++++--------------------------------- 2 files changed, 1262 insertions(+), 2656 deletions(-) diff --git a/composer.json b/composer.json index 0ff5f8c11..21f4c8b3b 100755 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "config": { "platform": { - "php": "7.2.34" + "php": "8.1" }, "sort-packages": true, "preferred-install": "dist", @@ -20,14 +20,14 @@ "prepend-autoloader": false }, "require": { - "php": ">=7.2", + "php": ">=8.1", "giggsey/libphonenumber-for-php": "^8.12", "gmponos/guzzle_logger": "^2.2", "guzzlehttp/guzzle": "^7.4", "prestashop/decimal": "^1.3", "prestashop/module-lib-guzzle-adapter": "^1.0", "prestashop/module-lib-mbo-installer": "^2.0", - "prestashop/module-lib-service-container": "^1.0", + "prestashop/module-lib-service-container": "^2.0", "prestashop/prestashop-accounts-installer": "^1.0", "ramsey/uuid": "^3.8", "segmentio/analytics-php": "^1.5", @@ -35,10 +35,12 @@ "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~5.7", - "prestashop/php-dev-tools": "~3.0", + "phpunit/phpunit": "~9.6.7", + "phpunit/php-code-coverage": "^9.2.31", + "nikic/php-parser": "^4.19.1", + "prestashop/php-dev-tools": "~5.0", "monolog/monolog": "^1.27.1", - "prestashop/autoindex": "^1.0" + "prestashop/autoindex": "^2.1" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index de9931dc0..cfe1ec604 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38c3ff6e8b0ad69217d568aacbee4d1e", + "content-hash": "9f099bc21ada302826d34670cae50afc", "packages": [ { "name": "clue/stream-filter", @@ -74,31 +74,36 @@ }, { "name": "giggsey/libphonenumber-for-php", - "version": "8.13.31", + "version": "8.13.52", "source": { "type": "git", "url": "https://github.com/giggsey/libphonenumber-for-php.git", - "reference": "a4934bddda4672d12f21728e08bd575913bdc310" + "reference": "cc9a82b237d79a85be47c0b06e3943f75ab35c32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/a4934bddda4672d12f21728e08bd575913bdc310", - "reference": "a4934bddda4672d12f21728e08bd575913bdc310", + "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/cc9a82b237d79a85be47c0b06e3943f75ab35c32", + "reference": "cc9a82b237d79a85be47c0b06e3943f75ab35c32", "shasum": "" }, "require": { - "giggsey/locale": "^1.7|^2.0", - "php": ">=5.3.2", + "giggsey/locale": "^2.0", + "php": "^7.4|^8.0", "symfony/polyfill-mbstring": "^1.17" }, + "replace": { + "giggsey/libphonenumber-for-php-lite": "self.version" + }, "require-dev": { - "pear/pear-core-minimal": "^1.9", + "friendsofphp/php-cs-fixer": "^3.64", + "pear/pear-core-minimal": "^1.10", "pear/pear_exception": "^1.0", - "pear/versioncontrol_git": "^0.5", - "phing/phing": "^2.7", - "php-coveralls/php-coveralls": "^1.0|^2.0", - "symfony/console": "^2.8|^3.0|^v4.4|^v5.2", - "symfony/phpunit-bridge": "^4.2 || ^5" + "pear/versioncontrol_git": "^0.7", + "phing/phing": "^3.0", + "php-coveralls/php-coveralls": "^2.0", + "phpunit/phpunit": "^9.6", + "symfony/console": "^v5.2", + "symfony/var-exporter": "^5.2" }, "type": "library", "extra": { @@ -142,27 +147,28 @@ "issues": "https://github.com/giggsey/libphonenumber-for-php/issues", "source": "https://github.com/giggsey/libphonenumber-for-php" }, - "time": "2024-02-26T08:31:45+00:00" + "time": "2024-12-13T09:08:43+00:00" }, { "name": "giggsey/locale", - "version": "2.5", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/giggsey/Locale.git", - "reference": "e6d4540109a01dd2bc7334cdc842d6a6a67cf239" + "reference": "a5c65ea3c2630f27ccb78977990eefbee6dd8f97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/giggsey/Locale/zipball/e6d4540109a01dd2bc7334cdc842d6a6a67cf239", - "reference": "e6d4540109a01dd2bc7334cdc842d6a6a67cf239", + "url": "https://api.github.com/repos/giggsey/Locale/zipball/a5c65ea3c2630f27ccb78977990eefbee6dd8f97", + "reference": "a5c65ea3c2630f27ccb78977990eefbee6dd8f97", "shasum": "" }, "require": { - "php": ">=7.2" + "php": "^7.4|^8.0" }, "require-dev": { "ext-json": "*", + "friendsofphp/php-cs-fixer": "^3.64", "pear/pear-core-minimal": "^1.9", "pear/pear_exception": "^1.0", "pear/versioncontrol_git": "^0.5", @@ -172,7 +178,8 @@ "symfony/console": "^5.0|^6.0", "symfony/filesystem": "^5.0|^6.0", "symfony/finder": "^5.0|^6.0", - "symfony/process": "^5.0|^6.0" + "symfony/process": "^5.0|^6.0", + "symfony/var-exporter": "^5.2|^6.0" }, "type": "library", "autoload": { @@ -194,9 +201,9 @@ "description": "Locale functions required by libphonenumber-for-php", "support": { "issues": "https://github.com/giggsey/Locale/issues", - "source": "https://github.com/giggsey/Locale/tree/2.5" + "source": "https://github.com/giggsey/Locale/tree/2.7.0" }, - "time": "2023-11-01T17:19:48+00:00" + "time": "2024-11-04T11:18:07+00:00" }, { "name": "gmponos/guzzle_logger", @@ -272,22 +279,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -298,9 +305,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -378,7 +385,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" }, "funding": [ { @@ -394,20 +401,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-24T11:22:20+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { @@ -415,7 +422,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -461,7 +468,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -477,20 +484,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -505,8 +512,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -577,7 +584,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -593,7 +600,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "paragonie/random_compat", @@ -647,16 +654,16 @@ }, { "name": "php-http/httplug", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", "shasum": "" }, "require": { @@ -698,22 +705,22 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.0" + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, - "time": "2023-04-14T15:10:03+00:00" + "time": "2024-09-23T11:39:58+00:00" }, { "name": "php-http/message", - "version": "1.16.0", + "version": "1.16.2", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd" + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/47a14338bf4ebd67d317bf1144253d7db4ab55fd", - "reference": "47a14338bf4ebd67d317bf1144253d7db4ab55fd", + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", "shasum": "" }, "require": { @@ -767,22 +774,22 @@ ], "support": { "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.16.0" + "source": "https://github.com/php-http/message/tree/1.16.2" }, - "time": "2023-05-17T06:43:38+00:00" + "time": "2024-10-02T11:34:13+00:00" }, { "name": "php-http/promise", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "2916a606d3b390f4e9e8e2b8dd68581508be0f07" + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/2916a606d3b390f4e9e8e2b8dd68581508be0f07", - "reference": "2916a606d3b390f4e9e8e2b8dd68581508be0f07", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", "shasum": "" }, "require": { @@ -819,9 +826,9 @@ ], "support": { "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.3.0" + "source": "https://github.com/php-http/promise/tree/1.3.1" }, - "time": "2024-01-04T18:49:48+00:00" + "time": "2024-03-15T13:55:21+00:00" }, { "name": "prestashop/decimal", @@ -1032,29 +1039,31 @@ }, { "name": "prestashop/module-lib-service-container", - "version": "1.4.0", + "version": "v2.0", "source": { "type": "git", "url": "https://github.com/PrestaShopCorp/module-lib-service-container.git", - "reference": "96f4f551b96cffb1f78462cd4722f0d2b057abda" + "reference": "5525b56513d9ddad6e4232dfd93a24e028efdca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/module-lib-service-container/zipball/96f4f551b96cffb1f78462cd4722f0d2b057abda", - "reference": "96f4f551b96cffb1f78462cd4722f0d2b057abda", + "url": "https://api.github.com/repos/PrestaShopCorp/module-lib-service-container/zipball/5525b56513d9ddad6e4232dfd93a24e028efdca7", + "reference": "5525b56513d9ddad6e4232dfd93a24e028efdca7", "shasum": "" }, "require": { "php": ">=5.6.0", - "prestashop/module-lib-cache-directory-provider": "^1.0", - "symfony/config": "^3.4", - "symfony/dependency-injection": "^3.4", - "symfony/expression-language": "^3.4", - "symfony/yaml": "^3.4" + "prestashop/module-lib-cache-directory-provider": "^1.0" }, "require-dev": { "phpunit/phpunit": "~5.7" }, + "suggest": { + "symfony/config": "Needed when the running PrestaShop does not already run with Symfony", + "symfony/dependency-injection": "Needed when the running PrestaShop does not already run with Symfony", + "symfony/expression-language": "Needed when the running PrestaShop does not already run with Symfony", + "symfony/yaml": "Needed when the running PrestaShop does not already run with Symfony" + }, "type": "library", "autoload": { "psr-4": { @@ -1080,9 +1089,9 @@ ], "support": { "issues": "https://github.com/PrestaShopCorp/module-lib-service-container/issues", - "source": "https://github.com/PrestaShopCorp/module-lib-service-container/tree/1.4.0" + "source": "https://github.com/PrestaShopCorp/module-lib-service-container/tree/v2.0" }, - "time": "2021-06-01T15:21:20+00:00" + "time": "2022-06-20T08:30:47+00:00" }, { "name": "prestashop/prestashop-accounts-installer", @@ -1124,103 +1133,6 @@ }, "time": "2023-05-04T07:24:48+00:00" }, - { - "name": "psr/cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/master" - }, - "time": "2016-08-06T20:24:11+00:00" - }, - { - "name": "psr/container", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" - }, - "time": "2021-03-05T17:36:06+00:00" - }, { "name": "psr/http-client", "version": "1.0.3", @@ -1275,20 +1187,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -1312,7 +1224,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -1324,9 +1236,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -1632,34 +1544,31 @@ }, { "name": "sentry/sentry", - "version": "1.11.0", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe" + "reference": "5bee26136ab3fc166334cd972892bf71bd361558" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe", - "reference": "159eeaa02bb2ef8a8ec669f3c88e4bff7e6a7ffe", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/5bee26136ab3fc166334cd972892bf71bd361558", + "reference": "5bee26136ab3fc166334cd972892bf71bd361558", "shasum": "" }, "require": { "ext-curl": "*", - "php": "^5.3|^7.0" + "php": ">=5.2.4" }, "conflict": { "raven/raven": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^1.8.0", - "monolog/monolog": "^1.0", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "monolog/monolog": "*", + "phpunit/phpunit": "^4.8 || ^5.0" }, "suggest": { - "ext-hash": "*", - "ext-json": "*", - "ext-mbstring": "*", "monolog/monolog": "Automatically capture Monolog events as breadcrumbs" }, "bin": [ @@ -1668,7 +1577,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -1694,64 +1603,40 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/1.11.0" + "source": "https://github.com/getsentry/sentry-php/tree/releases/1.6.x" }, - "time": "2020-02-12T18:38:11+00:00" + "time": "2017-02-03T07:32:53+00:00" }, { - "name": "symfony/cache", - "version": "v4.4.48", + "name": "symfony/deprecation-contracts", + "version": "v3.5.1", "source": { "type": "git", - "url": "https://github.com/symfony/cache.git", - "reference": "3b98ed664887ad197b8ede3da2432787212eb915" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/3b98ed664887ad197b8ede3da2432787212eb915", - "reference": "3b98ed664887ad197b8ede3da2432787212eb915", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/cache": "^1.0|^2.0", - "psr/log": "^1|^2|^3", - "symfony/cache-contracts": "^1.1.7|^2", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.2|^5.0" - }, - "conflict": { - "doctrine/dbal": "<2.7", - "symfony/dependency-injection": "<3.4", - "symfony/http-kernel": "<4.4|>=5.0", - "symfony/var-dumper": "<4.4" - }, - "provide": { - "psr/cache-implementation": "1.0|2.0", - "psr/simple-cache-implementation": "1.0|2.0", - "symfony/cache-implementation": "1.0|2.0" - }, - "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.7|^3.0", - "predis/predis": "^1.1", - "psr/simple-cache": "^1.0|^2.0", - "symfony/config": "^4.2|^5.0", - "symfony/dependency-injection": "^3.4|^4.1|^5.0", - "symfony/filesystem": "^4.4|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/var-dumper": "^4.4|^5.0" + "php": ">=8.1" }, "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Cache\\": "" + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" }, - "exclude-from-classmap": [ - "/Tests/" + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1768,14 +1653,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "keywords": [ - "caching", - "psr6" - ], "support": { - "source": "https://github.com/symfony/cache/tree/v4.4.48" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -1791,42 +1672,44 @@ "type": "tidelift" } ], - "time": "2022-10-17T20:21:54+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { - "name": "symfony/cache-contracts", - "version": "v2.5.2", + "name": "symfony/polyfill-ctype", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/cache-contracts.git", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", - "reference": "64be4a7acb83b6f2bf6de9a02cee6dad41277ebc", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0|^3.0" + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { - "symfony/cache-implementation": "" + "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Contracts\\Cache\\": "" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1835,26 +1718,24 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to caching", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -1870,48 +1751,45 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/config", - "version": "v3.4.47", + "name": "symfony/polyfill-mbstring", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", - "reference": "bc6b3fd3930d4b53a60b42fe2ed6fc466b75f03f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" + "php": ">=7.2" }, - "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "provide": { + "ext-mbstring": "*" }, "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "ext-mbstring": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1919,18 +1797,25 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/config/tree/v3.4.47" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1946,55 +1831,43 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v3.4.47", + "name": "webmozart/assert", + "version": "1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b" + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/51d2a2708c6ceadad84393f8581df1dcf9e5e84b", - "reference": "51d2a2708c6ceadad84393f8581df1dcf9e5e84b", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/container": "^1.0" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { - "symfony/config": "<3.3.7", - "symfony/finder": "<3.3", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "psr/container-implementation": "1.0" + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "symfony/config": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Webmozart\\Assert\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2002,1265 +1875,50 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v3.4.47" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, + "time": "2022-06-03T18:03:27+00:00" + } + ], + "packages-dev": [ { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "name": "doctrine/instantiator", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, - { - "name": "symfony/expression-language", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/expression-language.git", - "reference": "de38e66398fca1fcb9c48e80279910e6889cb28f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/de38e66398fca1fcb9c48e80279910e6889cb28f", - "reference": "de38e66398fca1fcb9c48e80279910e6889cb28f", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/cache": "~3.1|~4.0", - "symfony/polyfill-php70": "~1.6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\ExpressionLanguage\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony ExpressionLanguage Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/expression-language/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v4.4.42", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/815412ee8971209bd4c1eecd5f4f481eacd44bf5", - "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.42" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-20T08:49:14+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-30T19:17:29+00:00" - }, - { - "name": "symfony/var-exporter", - "version": "v5.4.35", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "abb0a151b62d6b07e816487e20040464af96cae7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/abb0a151b62d6b07e816487e20040464af96cae7", - "reference": "abb0a151b62d6b07e816487e20040464af96cae7", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "require-dev": { - "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\VarExporter\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", - "homepage": "https://symfony.com", - "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "serialize" - ], - "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.35" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-23T13:51:25+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" - } - ], - "packages-dev": [ - { - "name": "composer/pcre", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-21T20:24:37+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.0", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-08-31T09:50:34+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", - "shasum": "" - }, - "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-24T20:20:32+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.14.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^1 || ^2", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" - }, - "time": "2023-02-01T09:20:38+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" - }, - "time": "2024-01-30T19:34:25+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -3287,7 +1945,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -3303,194 +1961,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "doctrine/lexer", - "version": "2.1.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", - "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.21" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2024-02-05T11:35:39+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.3", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2021-11-15T17:17:55+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "monolog/monolog", @@ -3580,16 +2051,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -3597,11 +2068,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -3627,7 +2099,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -3635,28 +2107,29 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", - "version": "v3.1.5", + "version": "v4.19.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -3664,7 +2137,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -3688,329 +2161,168 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v3.1.5" - }, - "time": "2018-02-28T20:30:58+00:00" - }, - { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" - } - ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "abandoned": true, - "time": "2020-10-14T08:39:05+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2022-03-15T21:29:03+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.10.3", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" }, { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], + "description": "Library for handling version information and constraints", "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2020-03-05T15:02:03+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -4025,7 +2337,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4037,33 +2349,42 @@ "xunit" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/4.0" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, - "time": "2017-04-02T07:44:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4078,7 +2399,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4089,30 +2410,47 @@ "iterator" ], "support": { - "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, - "time": "2017-11-27T13:52:08+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -4129,41 +2467,47 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "template" + "process" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4178,46 +2522,51 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "timer" + "template" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, - "time": "2017-02-26T11:10:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "2.0.2", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": "^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -4232,68 +2581,73 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "tokenizer" + "timer" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, - "abandoned": true, - "time": "2017-11-27T05:48:46+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", - "version": "5.7.27", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" }, "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -4301,10 +2655,13 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "9.6-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -4329,241 +2686,317 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/5.7.27" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, - "time": "2018-02-01T05:50:59+00:00" + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-12-05T13:48:26+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "name": "prestashop/autoindex", + "version": "v2.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "url": "https://github.com/PrestaShopCorp/autoindex.git", + "reference": "235f3ec115432ffc32d582198ea498467b3946d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/235f3ec115432ffc32d582198ea498467b3946d0", + "reference": "235f3ec115432ffc32d582198ea498467b3946d0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "nikic/php-parser": "^4.10", + "php": "^8.0 || ^7.2", + "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" }, - "conflict": { - "phpunit/phpunit": "<5.4.0" + "require-dev": { + "phpstan/phpstan": "^0.12.83", + "prestashop/php-dev-tools": "1.*" + }, + "bin": [ + "bin/autoindex" + ], + "type": "library", + "autoload": { + "psr-4": { + "PrestaShop\\AutoIndex\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AFL-3.0" + ], + "authors": [ + { + "name": "PrestaShop SA", + "email": "contact@prestashop.com" + } + ], + "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", + "homepage": "https://github.com/PrestaShopCorp/autoindex", + "support": { + "source": "https://github.com/PrestaShopCorp/autoindex/tree/v2.1.0" + }, + "time": "2022-10-10T08:35:00+00:00" + }, + { + "name": "prestashop/php-dev-tools", + "version": "v5", + "source": { + "type": "git", + "url": "https://github.com/PrestaShop/php-dev-tools.git", + "reference": "4b284d9b07a274505c81144536924eb4014e6fbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/4b284d9b07a274505c81144536924eb4014e6fbf", + "reference": "4b284d9b07a274505c81144536924eb4014e6fbf", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/console": "~3.2 || ~4.0 || ~5.0 || ~6.0 || ~7.0", + "symfony/filesystem": "~3.2 || ~4.0 || ~5.0 || ~6.0 || ~7.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "friendsofphp/php-cs-fixer": "^3.2" }, "suggest": { - "ext-soap": "*" + "phpstan/phpstan": "^0.12", + "prestashop/autoindex": "^2.0", + "prestashop/header-stamp": "^2.0", + "squizlabs/php_codesniffer": "^3.4" }, + "bin": [ + "bin/prestashop-coding-standards" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PrestaShop\\CodingStandards\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "PrestaShop" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], + "description": "PrestaShop coding standards", "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/3.4" + "issues": "https://github.com/PrestaShop/php-dev-tools/issues", + "source": "https://github.com/PrestaShop/php-dev-tools/tree/v5" }, - "abandoned": true, - "time": "2017-06-30T09:13:00+00:00" + "time": "2024-05-23T12:27:45+00:00" }, { - "name": "prestashop/autoindex", - "version": "v1.0.0", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/PrestaShopCorp/autoindex.git", - "reference": "92e10242f94a99163dece280f6bd7b7c2b79c158" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/92e10242f94a99163dece280f6bd7b7c2b79c158", - "reference": "92e10242f94a99163dece280f6bd7b7c2b79c158", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "nikic/php-parser": "^3.1", - "php": ">=5.6", - "symfony/console": "^3.4", - "symfony/finder": "^3.4" + "php": ">=7.4.0" }, - "bin": [ - "bin/autoindex" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { - "PrestaShop\\AutoIndex\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "AFL-3.0" + "MIT" ], "authors": [ { - "name": "PrestaShop SA", - "email": "contact@prestashop.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", - "homepage": "https://github.com/PrestaShopCorp/autoindex", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], "support": { - "source": "https://github.com/PrestaShopCorp/autoindex/tree/v1.0.0" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2020-03-11T13:37:03+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "prestashop/header-stamp", - "version": "v1.7", + "name": "sebastian/cli-parser", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/PrestaShopCorp/header-stamp.git", - "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", - "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { - "nikic/php-parser": "^3.1", - "php": ">=5.6", - "symfony/console": "^3.4 || ~4.0 || ~5.0", - "symfony/finder": "^3.4 || ~4.0 || ~5.0" + "php": ">=7.3" }, "require-dev": { - "prestashop/php-dev-tools": "1.*" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "bin/header-stamp" - ], "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\HeaderStamp\\": "src/" + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "AFL-3.0" + "BSD-3-Clause" ], "authors": [ { - "name": "PrestaShop SA", - "email": "contact@prestashop.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "Rewrite your file headers to add the license or to make them up-to-date", - "homepage": "https://github.com/PrestaShopCorp/header-stamp", - "support": { - "issues": "https://github.com/PrestaShopCorp/header-stamp/issues", - "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v1.7" - }, - "time": "2020-12-09T16:40:38+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { - "name": "prestashop/php-dev-tools", - "version": "v3.16.1", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "785108c29ef6f580930372d88b8f551740fdee98" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/785108c29ef6f580930372d88b8f551740fdee98", - "reference": "785108c29ef6f580930372d88b8f551740fdee98", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "friendsofphp/php-cs-fixer": "^2.14", - "php": ">=5.6.0", - "prestashop/autoindex": "^1.0", - "prestashop/header-stamp": "^1.0", - "squizlabs/php_codesniffer": "^3.4", - "symfony/console": "~3.2 || ~4.0 || ~5.0", - "symfony/filesystem": "~3.2 || ~4.0 || ~5.0" + "php": ">=7.3" }, - "conflict": { - "friendsofphp/php-cs-fixer": "2.18.3" + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "bin": [ - "bin/prestashop-coding-standards" - ], "type": "library", - "autoload": { - "psr-4": { - "PrestaShop\\CodingStandards\\": "src/" + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "PrestaShop coding standards", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/PrestaShop/php-dev-tools/issues", - "source": "https://github.com/PrestaShop/php-dev-tools/tree/v3.16.1" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, - "time": "2021-10-18T07:48:21+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.3", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", - "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4585,7 +3018,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { @@ -4593,34 +3026,34 @@ "type": "github" } ], - "time": "2024-03-01T13:45:45+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4633,6 +3066,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -4644,14 +3081,10 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", @@ -4659,34 +3092,98 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, - "time": "2017-01-29T09:50:25+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4699,50 +3196,62 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, - "time": "2017-05-22T07:24:03+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4769,36 +3278,42 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/master" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, - "time": "2016-11-26T07:53:53+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4811,6 +3326,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -4819,50 +3338,55 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, - "time": "2016-11-19T08:54:04+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -4870,7 +3394,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -4895,35 +3419,99 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, - "time": "2015-10-12T03:26:01+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -4945,34 +3533,40 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, - "time": "2017-02-18T15:18:39+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "sebastian/recursion-context", - "version": "2.0.0", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -4986,47 +3580,111 @@ ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, - "time": "2016-11-19T07:33:16+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -5047,32 +3705,40 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, - "time": "2015-07-28T20:34:47+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "sebastian/type", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -5091,133 +3757,116 @@ "role": "lead" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, - "time": "2016-10-03T07:35:21+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "php": ">=7.3" }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "3.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" } ], - "time": "2024-02-16T15:06:51+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { "name": "symfony/console", - "version": "v3.4.47", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -5242,10 +3891,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/console/tree/v3.4.47" + "source": "https://github.com/symfony/console/tree/v6.4.15" }, "funding": [ { @@ -5261,36 +3916,34 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { - "name": "symfony/debug", - "version": "v4.4.44", + "name": "symfony/filesystem", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "1a692492190773c5310bc7877cb590c04c2f05be" + "url": "https://github.com/symfony/filesystem.git", + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be", - "reference": "1a692492190773c5310bc7877cb590c04c2f05be", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", + "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", "shasum": "" }, "require": { - "php": ">=7.1.3", - "psr/log": "^1|^2|^3" - }, - "conflict": { - "symfony/http-kernel": "<3.4" + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" + "symfony/process": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Component\\Filesystem\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5310,10 +3963,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools to ease debugging PHP code", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.44" + "source": "https://github.com/symfony/filesystem/tree/v6.4.13" }, "funding": [ { @@ -5329,53 +3982,32 @@ "type": "tidelift" } ], - "abandoned": "symfony/error-handler", - "time": "2022-07-28T16:29:46+00:00" + "time": "2024-10-25T15:07:50+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v4.4.44", + "name": "symfony/finder", + "version": "v6.4.13", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a" + "url": "https://github.com/symfony/finder.git", + "reference": "daea9eca0b08d0ed1dc9ab702a46128fd1be4958" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1e866e9e5c1b22168e0ce5f0b467f19bba61266a", - "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a", + "url": "https://api.github.com/repos/symfony/finder/zipball/daea9eca0b08d0ed1dc9ab702a46128fd1be4958", + "reference": "daea9eca0b08d0ed1dc9ab702a46128fd1be4958", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "php": ">=8.1" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/filesystem": "^6.0|^7.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5395,10 +4027,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.44" + "source": "https://github.com/symfony/finder/tree/v6.4.13" }, "funding": [ { @@ -5414,42 +4046,41 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2024-10-01T08:30:56+00:00" }, { - "name": "symfony/event-dispatcher-contracts", - "version": "v1.10.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/761c8b8387cfe5f8026594a75fdf0a4e83ba6974", - "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2" }, "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.1-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5466,18 +4097,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to dispatching event", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.10.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -5493,96 +4124,44 @@ "type": "tidelift" } ], - "time": "2022-07-20T09:59:04+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/finder", - "version": "v3.4.47", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "php": ">=7.2" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v3.4.47" + "suggest": { + "ext-intl": "For best performance" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } - ], - "time": "2020-11-16T17:02:08+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v5.4.21", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5591,23 +4170,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides an improved replacement for the array_replace PHP function", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", "keywords": [ - "config", - "configuration", - "options" + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -5623,39 +4205,47 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.29.0", + "name": "symfony/service-contracts", + "version": "v3.5.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", - "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "type": "library", "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5671,16 +4261,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -5696,30 +4288,46 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { - "name": "symfony/process", - "version": "v5.4.36", + "name": "symfony/string", + "version": "v6.4.15", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975" + "url": "https://github.com/symfony/string.git", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4fdf34004f149cc20b2f51d7d119aa500caad975", - "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Component\\String\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5731,18 +4339,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Executes commands in sub-processes", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], "support": { - "source": "https://github.com/symfony/process/tree/v5.4.36" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -5758,82 +4374,70 @@ "type": "tidelift" } ], - "time": "2024-02-12T15:49:53+00:00" + "time": "2024-11-13T13:31:12+00:00" }, { - "name": "symfony/stopwatch", - "version": "v5.4.35", + "name": "theseer/tokenizer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "887762aa99ff16f65dc8b48aafead415f942d407" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/887762aa99ff16f65dc8b48aafead415f942d407", - "reference": "887762aa99ff16f65dc8b48aafead415f942d407", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.35" + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/theseer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.2" + "php": ">=8.1" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { - "php": "7.2.34" + "php": "8.1" }, "plugin-api-version": "2.6.0" } From 5259d79710f2c9b66502d0ce8c0d5a7491426450 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Fri, 13 Dec 2024 17:50:55 +0200 Subject: [PATCH 02/38] AdminAjaxController response fixes --- .../AdminAjaxPrestashopCheckoutController.php | 131 +++++++++--------- 1 file changed, 68 insertions(+), 63 deletions(-) diff --git a/controllers/admin/AdminAjaxPrestashopCheckoutController.php b/controllers/admin/AdminAjaxPrestashopCheckoutController.php index b107e13aa..7c4444ad8 100755 --- a/controllers/admin/AdminAjaxPrestashopCheckoutController.php +++ b/controllers/admin/AdminAjaxPrestashopCheckoutController.php @@ -101,7 +101,7 @@ public function ajaxProcessUpdatePaymentMethodsOrder() $fundingSourceConfigurationRepository->save($paymentOption); } - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -113,7 +113,7 @@ public function ajaxProcessUpdatePaymentMode() $paypalConfiguration = $this->module->getService(PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); $paypalConfiguration->setPaymentMode(Tools::getValue('paymentMode')); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -125,7 +125,7 @@ public function ajaxProcessLiveStepConfirmed() $stepLive = $this->module->getService(LiveStep::class); $stepLive->confirmed(true); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -137,7 +137,7 @@ public function ajaxProcessLiveStepViewed() $stepLive = $this->module->getService(LiveStep::class); $stepLive->viewed(true); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -149,7 +149,7 @@ public function ajaxProcessValueBannerClosed() $valueBanner = $this->module->getService(ValueBanner::class); $valueBanner->closed(true); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -165,7 +165,7 @@ public function ajaxProcessEditRoundingSettings() $paypalConfiguration->setRoundType(RoundingSettings::ROUND_ON_EACH_ITEM); $paypalConfiguration->setPriceRoundMode(RoundingSettings::ROUND_UP_AWAY_FROM_ZERO); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -193,7 +193,7 @@ public function ajaxProcessTogglePaymentOptionAvailability() $fundingSourceConfigurationRepository->save($paymentOption); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -206,7 +206,7 @@ public function ajaxProcessUpdateCreditCardFields() $paypalConfiguration->setCardPaymentEnabled((bool) Tools::getValue('hostedFieldsEnabled')); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -220,7 +220,7 @@ public function ajaxProcessToggleECOrderPage() $this->updateExpressCheckoutSettings(); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -234,7 +234,7 @@ public function ajaxProcessToggleECCheckoutPage() $this->updateExpressCheckoutSettings(); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -248,7 +248,7 @@ public function ajaxProcessToggleECProductPage() $this->updateExpressCheckoutSettings(); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -357,19 +357,19 @@ public function ajaxProcessFetchOrder() if (empty($id_order)) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ $this->l('No PrestaShop Order identifier received'), ], - ])); + ]); } $order = new Order($id_order); if ($order->module !== $this->module->name) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ strtr( @@ -379,7 +379,7 @@ public function ajaxProcessFetchOrder() ] ), ], - ])); + ]); } $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); @@ -388,7 +388,7 @@ public function ajaxProcessFetchOrder() if (!$psCheckoutCartCollection->count()) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ strtr( @@ -398,7 +398,7 @@ public function ajaxProcessFetchOrder() ] ), ], - ])); + ]); } $psCheckoutCart = null; @@ -415,7 +415,7 @@ public function ajaxProcessFetchOrder() if ($configurationPayPal->getPaymentMode() !== $psCheckoutCart->getEnvironment()) { http_response_code(422); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ strtr( @@ -425,7 +425,7 @@ public function ajaxProcessFetchOrder() ] ), ], - ])); + ]); } /** @var PayPalOrderProvider $paypalOrderProvider */ @@ -457,12 +457,12 @@ public function ajaxProcessFetchOrder() 'isProductionEnv' => $psCheckoutCart->getEnvironment() === Mode::LIVE, ]); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => $isLegacy ? $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/ajaxPayPalOrderLegacy.tpl') : $this->context->smarty->fetch($this->module->getLocalPath() . 'views/templates/admin/ajaxPayPalOrder.tpl'), - ])); + ]); } /** @@ -565,30 +565,30 @@ public function ajaxProcessUpdateLoggerLevel() if (false === in_array($level, $levels, true)) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Logger level is invalid', ], - ])); + ]); } if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_LEVEL, $level)) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger level in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'level' => $level, ], - ])); + ]); } /** @@ -604,29 +604,29 @@ public function ajaxProcessUpdateLoggerHttpFormat() $format = Tools::getValue('httpFormat'); if (false === in_array($format, $formats, true)) { - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Logger http format is invalid', ], - ])); + ]); } if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_HTTP_FORMAT, $format)) { - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger http format in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'httpFormat' => $format, ], - ])); + ]); } /** @@ -638,20 +638,20 @@ public function ajaxProcessUpdateLoggerHttp() if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_HTTP, (int) $isEnabled)) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger http in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'isEnabled' => (int) $isEnabled, ], - ])); + ]); } /** @@ -663,30 +663,30 @@ public function ajaxProcessUpdateLoggerMaxFiles() if ($maxFiles < 0 || $maxFiles > 30) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Logger max files is invalid', ], - ])); + ]); } if (false === (bool) Configuration::updateGlobalValue(LoggerFactory::PS_CHECKOUT_LOGGER_MAX_FILES, $maxFiles)) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Unable to save logger max files in PrestaShop Configuration', ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'content' => [ 'maxFiles' => $maxFiles, ], - ])); + ]); } /** @@ -697,8 +697,7 @@ public function ajaxProcessGetLogFiles() /** @var LoggerFileFinder $loggerFileFinder */ $loggerFileFinder = $this->module->getService(LoggerFileFinder::class); - header('Content-type: application/json'); - $this->ajaxDie(json_encode($loggerFileFinder->getLogFileNames())); + $this->exitWithResponse($loggerFileFinder->getLogFileNames()); } /** @@ -706,20 +705,18 @@ public function ajaxProcessGetLogFiles() */ public function ajaxProcessGetLogs() { - header('Content-type: application/json'); - $filename = Tools::getValue('file'); $offset = (int) Tools::getValue('offset'); $limit = (int) Tools::getValue('limit'); if (empty($filename) || false === Validate::isFileName($filename)) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ 'Filename is invalid.', ], - ])); + ]); } /** @var LoggerDirectory $loggerDirectory */ @@ -736,15 +733,15 @@ public function ajaxProcessGetLogs() ); } catch (Exception $exception) { http_response_code(500); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => [ $exception->getMessage(), ], - ])); + ]); } - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => true, 'file' => $fileData['filename'], 'offset' => $fileData['offset'], @@ -752,7 +749,7 @@ public function ajaxProcessGetLogs() 'currentOffset' => $fileData['currentOffset'], 'eof' => (int) $fileData['eof'], 'lines' => $fileData['lines'], - ])); + ]); } /** @@ -764,7 +761,7 @@ public function ajaxProcessSavePaypalButtonConfiguration() $paypalConfiguration = $this->module->getService(PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); $paypalConfiguration->setButtonConfiguration(json_decode(Tools::getValue('configuration'))); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } /** @@ -811,10 +808,10 @@ public function initCursedPage() */ public function init() { - if (!isset($this->context->employee) || !$this->context->employee->isLoggedBack()) { - // Avoid redirection to Login page because Ajax doesn't support it - $this->initCursedPage(); - } +// if (!isset($this->context->employee) || !$this->context->employee->isLoggedBack()) { +// // Avoid redirection to Login page because Ajax doesn't support it +// $this->initCursedPage(); +// } parent::init(); } @@ -822,7 +819,7 @@ public function init() /** * {@inheritdoc} */ - protected function isAnonymousAllowed() + public function isAnonymousAllowed() { return false; } @@ -834,10 +831,10 @@ public function display() { if ($this->errors) { http_response_code(400); - $this->ajaxDie(json_encode([ + $this->exitWithResponse([ 'status' => false, 'errors' => $this->errors, - ])); + ]); } parent::display(); @@ -849,7 +846,7 @@ private function togglePayLaterConfiguration($method) $payLaterConfiguration = $this->module->getService(PayPalPayLaterConfiguration::class); $payLaterConfiguration->$method(Tools::getValue('status') ? true : false); - $this->ajaxDie(json_encode(true)); + $this->ajaxDie(true); } public function ajaxProcessUpsertSecretToken() @@ -870,7 +867,7 @@ public function ajaxProcessUpsertSecretToken() http_response_code($status ? 204 : 500); $response['status'] = $status; - $this->ajaxDie(json_encode($response)); + $this->exitWithResponse($response); } public function ajaxProcessCheckConfiguration() @@ -1067,4 +1064,12 @@ public function ajaxProcessDownloadLogs() readfile($file->getRealPath()); exit; } + + public function ajaxDie($value = null, $controller = null, $method = null) + { + header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); + header('Content-type: application/json'); + echo json_encode($value); + exit; + } } From 5ea8fca4c2bc9bd9e326e608cee5a79ecd3508b7 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Fri, 8 Nov 2024 16:02:06 +0200 Subject: [PATCH 03/38] Command handler fix --- config/cache.yml | 16 ++-- config/command-handlers.yml | 4 +- config/common.yml | 88 +++++++++++-------- controllers/front/create.php | 3 + controllers/front/payment.php | 4 +- ps_checkout.php | 2 + .../CancelCheckoutCommandHandler.php | 2 +- .../SaveCheckoutCommandHandler.php | 2 +- .../SavePayPalOrderStatusCommandHandler.php | 2 +- ...atePaymentMethodSelectedCommandHandler.php | 2 +- .../CheckoutEventSubscriber.php | 19 ++-- src/CommandBus/TacticianCommandBusAdapter.php | 8 +- src/CommandBus/TacticianCommandBusFactory.php | 47 ++++------ .../ToggleShopConfigurationCommandHandler.php | 2 +- src/Handler/CreatePaypalOrderHandler.php | 2 +- .../AddOrderPaymentCommandHandler.php | 2 +- .../CreateOrderCommandHandler.php | 2 +- .../UpdateOrderStatusCommandHandler.php | 2 +- .../EventSubscriber/OrderEventSubscriber.php | 7 +- .../UpdateOrderMatriceCommandHandler.php | 2 +- ...etOrderForApprovalReversedQueryHandler.php | 2 +- ...etOrderForPaymentCompletedQueryHandler.php | 2 +- .../GetOrderForPaymentDeniedQueryHandler.php | 2 +- .../GetOrderForPaymentPendingQueryHandler.php | 2 +- ...GetOrderForPaymentRefundedQueryHandler.php | 2 +- ...GetOrderForPaymentReversedQueryHandler.php | 2 +- .../GetApplePayPaymentRequestQueryHandler.php | 2 +- .../SavePayPalCustomerCommandHandler.php | 2 +- ...etGooglePayTransactionInfoQueryHandler.php | 2 +- src/PayPal/OAuth/PayPalCustomerIdProvider.php | 29 ++++++ .../GetPayPalGetUserIdTokenQueryHandler.php | 2 +- .../CapturePayPalOrderCommandHandler.php | 4 +- .../CreatePayPalOrderCommandHandler.php | 29 +++--- .../SavePayPalOrderCommandHandler.php | 2 +- .../UpdatePayPalOrderCommandHandler.php | 2 +- .../PayPalOrderEventSubscriber.php | 2 +- ...etCurrentPayPalOrderStatusQueryHandler.php | 2 +- ...GetPayPalOrderForAdminViewQueryHandler.php | 2 +- .../GetPayPalOrderForCartIdQueryHandler.php | 4 +- ...lOrderForCheckoutCompletedQueryHandler.php | 4 +- ...lOrderForOrderConfirmationQueryHandler.php | 4 +- .../GetPayPalOrderQueryHandler.php | 4 +- src/PayPal/PayPalOrderProvider.php | 4 +- .../PayPalCaptureEventSubscriber.php | 2 +- .../RefundPayPalCaptureCommandHandler.php | 2 +- .../PayPalRefundEventSubscriber.php | 6 +- .../DeletePaymentTokenCommandHandler.php | 2 +- .../SavePaymentTokenCommandHandler.php | 2 +- .../GetCustomerPaymentTokensQueryHandler.php | 2 +- .../Sdk/PayPalSdkConfigurationBuilder.php | 17 ++-- src/Repository/PsCheckoutCartRepository.php | 38 ++++---- ...ebhookEventConfigurationUpdatedHandler.php | 2 +- src/Webhook/WebhookHandler.php | 2 +- 53 files changed, 223 insertions(+), 182 deletions(-) create mode 100644 src/PayPal/OAuth/PayPalCustomerIdProvider.php diff --git a/config/cache.yml b/config/cache.yml index 397b22943..48a4c4b98 100644 --- a/config/cache.yml +++ b/config/cache.yml @@ -8,17 +8,17 @@ services: - !php/const _PS_MODE_DEV_ ps_checkout.cache.array.paypal.order: - class: 'Symfony\Component\Cache\Simple\ArrayCache' + class: 'Symfony\Component\Cache\Adapter\ArrayAdapter' ps_checkout.cache.filesystem.paypal.order: - class: 'Symfony\Component\Cache\Simple\FilesystemCache' + class: 'Symfony\Component\Cache\Adapter\FilesystemAdapter' arguments: - "paypal-orders" - 3600 - '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()' ps_checkout.cache.paypal.order: - class: 'Symfony\Component\Cache\Simple\ChainCache' + class: 'Symfony\Component\Cache\Adapter\ChainAdapter' public: true arguments: - [ @@ -27,17 +27,17 @@ services: ] ps_checkout.cache.array.paypal.capture: - class: 'Symfony\Component\Cache\Simple\ArrayCache' + class: 'Symfony\Component\Cache\Adapter\ArrayAdapter' ps_checkout.cache.filesystem.paypal.capture: - class: 'Symfony\Component\Cache\Simple\FilesystemCache' + class: 'Symfony\Component\Cache\Adapter\FilesystemAdapter' arguments: - "paypal-capture" - 3600 - '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()' ps_checkout.cache.paypal.capture: - class: 'Symfony\Component\Cache\Simple\ChainCache' + class: 'Symfony\Component\Cache\Adapter\ChainAdapter' public: true arguments: - [ @@ -46,9 +46,9 @@ services: ] ps_checkout.cache.pscheckoutcart: - class: 'Symfony\Component\Cache\Simple\ArrayCache' + class: 'Symfony\Component\Cache\Adapter\ArrayAdapter' public: true ps_checkout.cache.order: - class: 'Symfony\Component\Cache\Simple\ArrayCache' + class: 'Symfony\Component\Cache\Adapter\ArrayAdapter' public: true diff --git a/config/command-handlers.yml b/config/command-handlers.yml index e1c3d4c8c..d980e6fd9 100644 --- a/config/command-handlers.yml +++ b/config/command-handlers.yml @@ -38,9 +38,11 @@ services: - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' +# - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' + tags: + - { name: messenger.message_handler, bus: ps_checkout.bus.command } PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler' diff --git a/config/common.yml b/config/common.yml index 013d923e1..d600b0888 100644 --- a/config/common.yml +++ b/config/common.yml @@ -42,53 +42,52 @@ services: arguments: - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - ps_checkout.tactician.bus: - class: 'League\Tactician\CommandBus' - factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] - ps_checkout.bus.command: class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusAdapter' public: true + factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] + + app.command_handler_locator: + class: Symfony\Component\DependencyInjection\ServiceLocator arguments: - - "@ps_checkout.tactician.bus" + - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler' PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory: class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory' public: true arguments: - - "@ps_checkout.module" - "@ps_checkout.logger" - - PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand: 'PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\UpdatePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\CancelCheckoutCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler' - PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand: 'PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentDeniedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentPendingQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentReversedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler' - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery: 'PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetCurrentPayPalOrderStatusQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Customer\Command\SavePayPalCustomerCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler' - PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery: 'PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler' + - PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand: ['@PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\UpdatePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\CancelCheckoutCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\CancelCheckoutCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentDeniedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentPendingQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentReversedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler'] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetCurrentPayPalOrderStatusQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Customer\Command\SavePayPalCustomerCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler'] + PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler'] PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory: class: 'PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory' @@ -102,7 +101,7 @@ services: public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' - - '@ps_checkout.bus.command' + - '@ps_checkout.module' - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber: @@ -111,6 +110,9 @@ services: arguments: - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - '@ps_checkout.module' + calls: + - method: setCommandBus + arguments: [ '@ps_checkout.bus.command' ] PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber' @@ -228,7 +230,6 @@ services: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder' public: true arguments: - - '@ps_checkout.module' - '@PrestaShop\Module\PrestashopCheckout\Environment\Env' - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalPayLaterConfiguration' @@ -238,6 +239,7 @@ services: - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - '@ps_checkout.logger' - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider' PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule: class: 'PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule' @@ -486,3 +488,11 @@ services: public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Translations\Translations' + + PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider: + class: 'PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider' + public: true + arguments: + - '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\OAuthService' + - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' diff --git a/controllers/front/create.php b/controllers/front/create.php index be79195fd..0ff7a6125 100755 --- a/controllers/front/create.php +++ b/controllers/front/create.php @@ -130,6 +130,9 @@ public function postProcess() $commandBus = $this->module->getService('ps_checkout.bus.command'); $commandBus->handle(new CreatePayPalOrderCommand($cartId, $fundingSource, $isCardFields, $isExpressCheckout, $vaultId, $favorite, $vault)); + /** @var \PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface $eventDispatcher */ + $eventDispatcher = $this->module->getService('ps_checkout.event_dispatcher'); + /** @var GetPayPalOrderForCartIdQueryResult $getPayPalOrderForCartIdQueryResult */ $getPayPalOrderForCartIdQueryResult = $commandBus->handle(new GetPayPalOrderForCartIdQuery($cartId)); $order = $getPayPalOrderForCartIdQueryResult->getOrder(); diff --git a/controllers/front/payment.php b/controllers/front/payment.php index 54e7e9402..b87e3d889 100644 --- a/controllers/front/payment.php +++ b/controllers/front/payment.php @@ -85,7 +85,7 @@ public function postProcess() $payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class); /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); - /** @var Psr\SimpleCache\CacheInterface $payPalOrderCache */ + /** @var Symfony\Contracts\Cache\CacheInterface $payPalOrderCache */ $payPalOrderCache = $this->module->getService('ps_checkout.cache.paypal.order'); $payPalOrder = $payPalOrderRepository->getPayPalOrderById($this->paypalOrderId); @@ -102,7 +102,7 @@ public function postProcess() if ($payPalOrderFromCache['status'] === 'PAYER_ACTION_REQUIRED') { // Delete from cache so when user is redirected from 3DS authentication page the order is fetched from PayPal - if ($payPalOrderCache->has($this->paypalOrderId->getValue())) { + if ($payPalOrderCache->hasItem($this->paypalOrderId->getValue())) { $payPalOrderCache->delete($this->paypalOrderId->getValue()); } diff --git a/ps_checkout.php b/ps_checkout.php index 9b274a7ce..562608b9f 100755 --- a/ps_checkout.php +++ b/ps_checkout.php @@ -937,6 +937,8 @@ public function hookActionFrontControllerSetMedia() if (false === $frontControllerValidator->shouldLoadFrontJS($controller)) { return; } +// $sfContainer = PrestaShop\PrestaShop\Adapter\SymfonyContainer::getInstance(); + $commandBus = $this->get('prestashop.core.filter.front_end_object.main'); /** @var \PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder $payPalSdkConfigurationBuilder */ $payPalSdkConfigurationBuilder = $this->getService(\PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder::class); diff --git a/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php b/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php index 36610d03a..3b29c6040 100644 --- a/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php +++ b/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php @@ -44,7 +44,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * * @throws PsCheckoutSessionException */ - public function handle(CancelCheckoutCommand $command) + public function __invoke(CancelCheckoutCommand $command) { try { /** @var PsCheckoutCart|false $psCheckoutCart */ diff --git a/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php b/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php index 3855f1bbb..4aa593ef3 100644 --- a/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php +++ b/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php @@ -43,7 +43,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * * @throws PsCheckoutSessionException */ - public function handle(SaveCheckoutCommand $command) + public function __invoke(SaveCheckoutCommand $command) { try { /** @var PsCheckoutCart|false $psCheckoutCart */ diff --git a/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php b/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php index fff4db8e4..8644549c5 100644 --- a/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php +++ b/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php @@ -50,7 +50,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository, * * @throws PsCheckoutSessionException */ - public function handle(SavePayPalOrderStatusCommand $command) + public function __invoke(SavePayPalOrderStatusCommand $command) { // TODO: To be repurposed try { diff --git a/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php b/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php index 09eb8b08f..ce6e51a5c 100644 --- a/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php +++ b/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php @@ -44,7 +44,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * * @throws PsCheckoutSessionException */ - public function handle(UpdatePaymentMethodSelectedCommand $command) + public function __invoke(UpdatePaymentMethodSelectedCommand $command) { try { /** @var PsCheckoutCart|false $psCheckoutCart */ diff --git a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php index b393f1907..ff244da6e 100644 --- a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php +++ b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php @@ -62,11 +62,12 @@ class CheckoutEventSubscriber implements EventSubscriberInterface */ private $psCheckoutCartRepository; - public function __construct(CheckoutChecker $checkoutChecker, CommandBusInterface $commandBus, PsCheckoutCartRepository $psCheckoutCartRepository) + public function __construct(CheckoutChecker $checkoutChecker, Ps_checkout $module, PsCheckoutCartRepository $psCheckoutCartRepository) { $this->checkoutChecker = $checkoutChecker; - $this->commandBus = $commandBus; + $this->module = $module; $this->psCheckoutCartRepository = $psCheckoutCartRepository; +// $this->commandBus = $this->module->getService('ps_checkout.bus.command'); } /** @@ -135,12 +136,12 @@ public function proceedToPayment(CheckoutCompletedEvent $event) $this->checkoutChecker->continueWithAuthorization($event->getCartId()->getValue(), $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder()); try { - $this->commandBus->handle( - new CapturePayPalOrderCommand( - $event->getPayPalOrderId()->getValue(), - $event->getFundingSource() - ) - ); +// $this->commandBus->handle( +// new CapturePayPalOrderCommand( +// $event->getPayPalOrderId()->getValue(), +// $event->getFundingSource() +// ) +// ); } catch (PayPalException $exception) { if ($exception->getCode() === PayPalException::ORDER_NOT_APPROVED) { $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); @@ -161,7 +162,7 @@ public function proceedToPayment(CheckoutCompletedEvent $event) throw $exception; } } catch (HttpTimeoutException $exception) { - $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); +// $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); return; } diff --git a/src/CommandBus/TacticianCommandBusAdapter.php b/src/CommandBus/TacticianCommandBusAdapter.php index d25a7cae7..8eeb14c66 100644 --- a/src/CommandBus/TacticianCommandBusAdapter.php +++ b/src/CommandBus/TacticianCommandBusAdapter.php @@ -20,19 +20,19 @@ namespace PrestaShop\Module\PrestashopCheckout\CommandBus; -use League\Tactician\CommandBus; +use PrestaShopBundle\CommandBus\MessengerCommandBus; class TacticianCommandBusAdapter implements CommandBusInterface { /** - * @var CommandBus + * @var MessengerCommandBus */ private $bus; /** - * @param CommandBus $bus + * @param MessengerCommandBus $bus */ - public function __construct(CommandBus $bus) + public function __construct(MessengerCommandBus $bus) { $this->bus = $bus; } diff --git a/src/CommandBus/TacticianCommandBusFactory.php b/src/CommandBus/TacticianCommandBusFactory.php index 5e137409d..c400b946f 100644 --- a/src/CommandBus/TacticianCommandBusFactory.php +++ b/src/CommandBus/TacticianCommandBusFactory.php @@ -20,22 +20,14 @@ namespace PrestaShop\Module\PrestashopCheckout\CommandBus; -use League\Tactician\CommandBus; -use League\Tactician\Handler\CommandHandlerMiddleware; -use League\Tactician\Handler\CommandNameExtractor\ClassNameExtractor; -use League\Tactician\Handler\MethodNameInflector\HandleInflector; -use League\Tactician\Logger\Formatter\ClassPropertiesFormatter; -use League\Tactician\Logger\LoggerMiddleware; -use Ps_checkout; +use PrestaShopBundle\CommandBus\MessengerCommandBus; use Psr\Log\LoggerInterface; +use Symfony\Component\Messenger\Handler\HandlersLocator; +use Symfony\Component\Messenger\MessageBus; +use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware; class TacticianCommandBusFactory { - /** - * @var Ps_checkout - */ - private $module; - /** * @var array */ @@ -47,35 +39,30 @@ class TacticianCommandBusFactory private $logger; /** - * @param Ps_checkout $module * @param LoggerInterface $logger * @param array $commandToHandlerMap */ - public function __construct(Ps_checkout $module, LoggerInterface $logger, array $commandToHandlerMap) + public function __construct(LoggerInterface $logger, array $commandToHandlerMap) { - $this->module = $module; $this->logger = $logger; $this->commandToHandlerMap = $commandToHandlerMap; } /** - * @return CommandBus + * @return TacticianCommandBusAdapter */ public function create() { - return new CommandBus([ - new LoggerMiddleware( - new ClassPropertiesFormatter(), - $this->logger - ), - new CommandHandlerMiddleware( - new ClassNameExtractor(), - new TacticianContainerLocator( - $this->module, - $this->commandToHandlerMap - ), - new HandleInflector() - ), - ]); + $handlerMiddleWare = new HandleMessageMiddleware( + new HandlersLocator($this->commandToHandlerMap), + ); + + $handlerMiddleWare->setLogger($this->logger); + + $messengerBus = new MessengerCommandBus( + new MessageBus([$handlerMiddleWare]) + ); + + return new TacticianCommandBusAdapter($messengerBus); } } diff --git a/src/Configuration/ToggleShopConfigurationCommandHandler.php b/src/Configuration/ToggleShopConfigurationCommandHandler.php index 9756cfd3f..867366b65 100644 --- a/src/Configuration/ToggleShopConfigurationCommandHandler.php +++ b/src/Configuration/ToggleShopConfigurationCommandHandler.php @@ -37,7 +37,7 @@ public function __construct() /** * @param ToggleShopConfigurationCommand $command */ - public function handle(ToggleShopConfigurationCommand $command) + public function __invoke(ToggleShopConfigurationCommand $command) { // Due to static cache in Shop::isFeatureActive(), we have to execute this to retrieve an accurate value $isMultiShopEnabled = (bool) $this->db->getValue('SELECT `value` FROM `' . _DB_PREFIX_ . 'configuration` WHERE `name` = "PS_MULTISHOP_FEATURE_ACTIVE"') diff --git a/src/Handler/CreatePaypalOrderHandler.php b/src/Handler/CreatePaypalOrderHandler.php index beb2d808f..13471047b 100644 --- a/src/Handler/CreatePaypalOrderHandler.php +++ b/src/Handler/CreatePaypalOrderHandler.php @@ -55,7 +55,7 @@ public function __construct(Context $context) * * @throws PsCheckoutException */ - public function handle($expressCheckout = false, $isCardPayment = false, $updateOrder = false, $paypalOrderId = null) + public function __invoke($expressCheckout = false, $isCardPayment = false, $updateOrder = false, $paypalOrderId = null) { // Present an improved cart in order to create the payload $cartPresenter = (new CartPresenter())->present(); diff --git a/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php b/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php index 432b31b9c..b6f4ac66d 100644 --- a/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php +++ b/src/Order/CommandHandler/AddOrderPaymentCommandHandler.php @@ -66,7 +66,7 @@ public function __construct( * @throws OrderException * @throws OrderPaymentException */ - public function handle(AddOrderPaymentCommand $command) + public function __invoke(AddOrderPaymentCommand $command) { $order = $this->getOrder($command->getOrderId()); $currency = Currency::getCurrencyInstance($command->getPaymentCurrencyId()); diff --git a/src/Order/CommandHandler/CreateOrderCommandHandler.php b/src/Order/CommandHandler/CreateOrderCommandHandler.php index 2a6d0ee4c..0c83aead2 100644 --- a/src/Order/CommandHandler/CreateOrderCommandHandler.php +++ b/src/Order/CommandHandler/CreateOrderCommandHandler.php @@ -112,7 +112,7 @@ public function __construct( * @throws PrestaShopException * @throws PsCheckoutException */ - public function handle(CreateOrderCommand $command) + public function __invoke(CreateOrderCommand $command) { /** @var PsCheckoutCart $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($command->getOrderPayPalId()->getValue()); diff --git a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php index 199d1735a..451a21ab1 100644 --- a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php +++ b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php @@ -48,7 +48,7 @@ public function __construct(EventDispatcherInterface $eventDispatcher) * * @throws OrderException */ - public function handle(UpdateOrderStatusCommand $command) + public function __invoke(UpdateOrderStatusCommand $command) { $order = $this->getOrder($command->getOrderId()); $orderCurrentState = (int) $order->getCurrentState(); diff --git a/src/Order/EventSubscriber/OrderEventSubscriber.php b/src/Order/EventSubscriber/OrderEventSubscriber.php index 59dff925a..9a98c051c 100644 --- a/src/Order/EventSubscriber/OrderEventSubscriber.php +++ b/src/Order/EventSubscriber/OrderEventSubscriber.php @@ -45,7 +45,12 @@ class OrderEventSubscriber implements EventSubscriberInterface public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository, Ps_checkout $module) { $this->psCheckoutCartRepository = $psCheckoutCartRepository; - $this->commandBus = $module->getService('ps_checkout.bus.command'); +// $this->commandBus = $module->getService('ps_checkout.bus.command'); + } + + public function setCommandBus(CommandBusInterface $commandBus) + { + $this->commandBus = $commandBus; } /** diff --git a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php index 715e871da..0e18cfd22 100644 --- a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php +++ b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php @@ -37,7 +37,7 @@ public function __construct(EventDispatcherInterface $eventDispatcher) * @throws \PrestaShopException * @throws \PrestaShopDatabaseException */ - public function handle(UpdateOrderMatriceCommand $command) + public function __invoke(UpdateOrderMatriceCommand $command) { $orderMatrice = new \OrderMatrice(); $orderMatrice->id_order_prestashop = $command->getOrderId()->getValue(); diff --git a/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php b/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php index b188f5673..f6443e129 100644 --- a/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForApprovalReversedQueryHandler.php @@ -57,7 +57,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForApprovalReversedQuery $query) + public function __invoke(GetOrderForApprovalReversedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php index b94423127..d4762c8b6 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentCompletedQueryHandler.php @@ -57,7 +57,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentCompletedQuery $query) + public function __invoke(GetOrderForPaymentCompletedQuery $query) { $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php index 8b8347e07..02a69a7f1 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentDeniedQueryHandler.php @@ -57,7 +57,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentDeniedQuery $query) + public function __invoke(GetOrderForPaymentDeniedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php index a978cebe2..830e000cb 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentPendingQueryHandler.php @@ -57,7 +57,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentPendingQuery $query) + public function __invoke(GetOrderForPaymentPendingQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php index bc94cb115..6d30dba62 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentRefundedQueryHandler.php @@ -57,7 +57,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentRefundedQuery $query) + public function __invoke(GetOrderForPaymentRefundedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php b/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php index 06676d5b7..9a6947287 100644 --- a/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php +++ b/src/Order/QueryHandler/GetOrderForPaymentReversedQueryHandler.php @@ -57,7 +57,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * @throws PrestaShopDatabaseException * @throws PrestaShopException */ - public function handle(GetOrderForPaymentReversedQuery $query) + public function __invoke(GetOrderForPaymentReversedQuery $query) { /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($query->getOrderPayPalId()->getValue()); diff --git a/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php b/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php index 9e6207f59..c8d51a307 100644 --- a/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php +++ b/src/PayPal/ApplePay/Query/GetApplePayPaymentRequestQueryHandler.php @@ -44,7 +44,7 @@ public function __construct(ApplePayPaymentRequestBuilder $builder) * * @throws PsCheckoutException */ - public function handle(GetApplePayPaymentRequestQuery $query) + public function __invoke(GetApplePayPaymentRequestQuery $query) { $cartPresenter = new CartPresenter(); $cart = $cartPresenter->present(); diff --git a/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php b/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php index 7e381e7e1..ded20a410 100644 --- a/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php +++ b/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php @@ -35,7 +35,7 @@ public function __construct(PayPalCustomerRepository $payPalCustomerRepository) $this->payPalCustomerRepository = $payPalCustomerRepository; } - public function handle(SavePayPalCustomerCommand $command) + public function __invoke(SavePayPalCustomerCommand $command) { try { $this->payPalCustomerRepository->findPayPalCustomerIdByCustomerId($command->getCustomerId()); diff --git a/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php b/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php index 4e0f5fe93..24dc285fc 100644 --- a/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php +++ b/src/PayPal/GooglePay/Query/GetGooglePayTransactionInfoQueryHandler.php @@ -44,7 +44,7 @@ public function __construct(GooglePayTransactionInfoBuilder $builder) * * @throws PsCheckoutException */ - public function handle(GetGooglePayTransactionInfoQuery $query) + public function __invoke(GetGooglePayTransactionInfoQuery $query) { $cartPresenter = (new CartPresenter())->present(); $orderPayloadBuilder = new OrderPayloadBuilder($cartPresenter); diff --git a/src/PayPal/OAuth/PayPalCustomerIdProvider.php b/src/PayPal/OAuth/PayPalCustomerIdProvider.php new file mode 100644 index 000000000..625fe3aa0 --- /dev/null +++ b/src/PayPal/OAuth/PayPalCustomerIdProvider.php @@ -0,0 +1,29 @@ +OAuthService = $OAuthService; + $this->customerRepository = $customerRepository; + $this->payPalConfiguration = $payPalConfiguration; + } + + public function getCustomerId(CustomerId $customerId = null) + { + $customerIdPayPal = $customerId ? $this->customerRepository->findPayPalCustomerIdByCustomerId($customerId) : null; + $merchantId = $this->payPalConfiguration->getMerchantId(); + + return $this->OAuthService->getUserIdToken($merchantId, $customerIdPayPal); + } +} diff --git a/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php b/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php index 821616b34..e877af198 100644 --- a/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php +++ b/src/PayPal/OAuth/Query/GetPayPalGetUserIdTokenQueryHandler.php @@ -59,7 +59,7 @@ public function __construct(OAuthService $OAuthService, PayPalCustomerRepository * * @throws Exception */ - public function handle(GetPayPalGetUserIdTokenQuery $query) + public function __invoke(GetPayPalGetUserIdTokenQuery $query) { $customerIdPayPal = $query->getCustomerId() ? $this->customerRepository->findPayPalCustomerIdByCustomerId($query->getCustomerId()) : null; $merchantId = $this->payPalConfiguration->getMerchantId(); diff --git a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php index eb42059fb..c23f20f2b 100644 --- a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php @@ -41,7 +41,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPalProcessorResponse; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; class CapturePayPalOrderCommandHandler { @@ -88,7 +88,7 @@ public function __construct( $this->payPalOrderRepository = $payPalOrderRepository; } - public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) + public function __invoke(CapturePayPalOrderCommand $capturePayPalOrderCommand) { $context = Context::getContext(); $merchantId = Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT', null, null, $context->shop->id); diff --git a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php index 3dd9fa832..fecd3504d 100644 --- a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php @@ -26,6 +26,7 @@ use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; +use PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter; use PrestaShop\Module\PrestashopCheckout\Exception\InvalidRequestException; use PrestaShop\Module\PrestashopCheckout\Exception\NotAuthorizedException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; @@ -71,13 +72,13 @@ public function __construct( MaaslandHttpClient $maaslandHttpClient, ShopContext $shopContext, PrestaShopContext $prestaShopContext, - EventDispatcherInterface $eventDispatcher, +// EventDispatcherInterface $eventDispatcher, PayPalCustomerRepository $payPalCustomerRepository, PaymentTokenRepository $paymentTokenRepository ) { $this->maaslandHttpClient = $maaslandHttpClient; $this->shopContext = $shopContext; - $this->eventDispatcher = $eventDispatcher; +// $this->eventDispatcher = $eventDispatcher; $this->payPalCustomerRepository = $payPalCustomerRepository; $this->paymentTokenRepository = $paymentTokenRepository; $this->prestaShopContext = $prestaShopContext; @@ -95,8 +96,10 @@ public function __construct( * @throws UnprocessableEntityException * @throws Exception * @throws PsCheckoutException + * + * @return void */ - public function handle(CreatePayPalOrderCommand $command) + public function __invoke(CreatePayPalOrderCommand $command) { $cartPresenter = (new CartPresenter())->present(); $builder = new OrderPayloadBuilder($cartPresenter); @@ -150,15 +153,15 @@ public function handle(CreatePayPalOrderCommand $command) $customerIntent[] = PayPalOrder::CUSTOMER_INTENT_FAVORITE; } - $this->eventDispatcher->dispatch(new PayPalOrderCreatedEvent( - $order['id'], - $order, - $command->getCartId()->getValue(), - $command->getFundingSource(), - $command->isHostedFields(), - $command->isExpressCheckout(), - $customerIntent, - $command->getPaymentTokenId() - )); +// $this->eventDispatcher->dispatch(new PayPalOrderCreatedEvent( +// $order['id'], +// $order, +// $command->getCartId()->getValue(), +// $command->getFundingSource(), +// $command->isHostedFields(), +// $command->isExpressCheckout(), +// $customerIntent, +// $command->getPaymentTokenId() +// )); } } diff --git a/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php index 946c13129..56a24e1a5 100644 --- a/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php @@ -42,7 +42,7 @@ public function __construct(PayPalOrderRepository $payPalOrderRepository) $this->payPalOrderRepository = $payPalOrderRepository; } - public function handle(SavePayPalOrderCommand $command) + public function __invoke(SavePayPalOrderCommand $command) { $order = $command->getOrder(); diff --git a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php index 5e65221f4..e671cbf0b 100644 --- a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php @@ -81,7 +81,7 @@ public function __construct( * * @throws CartException|PayPalException|PayPalOrderException|PsCheckoutException|Exception */ - public function handle(UpdatePayPalOrderCommand $command) + public function __invoke(UpdatePayPalOrderCommand $command) { try { $paypalOrder = $this->paypalOrderProvider->getById($command->getPayPalOrderId()->getValue()); diff --git a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php index cd03d5b44..18508b427 100644 --- a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php +++ b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php @@ -47,7 +47,7 @@ use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; use Ps_checkout; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalOrderEventSubscriber implements EventSubscriberInterface diff --git a/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php b/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php index bcea288d6..b6ff426cc 100644 --- a/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetCurrentPayPalOrderStatusQueryHandler.php @@ -39,7 +39,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) $this->psCheckoutCartRepository = $psCheckoutCartRepository; } - public function handle(GetCurrentPayPalOrderStatusQuery $getPayPalOrderQuery) + public function __invoke(GetCurrentPayPalOrderStatusQuery $getPayPalOrderQuery) { try { $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($getPayPalOrderQuery->getOrderPayPalId()->getValue()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php index c41d2f7a4..8fd679c7d 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForAdminViewQueryHandler.php @@ -25,7 +25,7 @@ class GetPayPalOrderForAdminViewQueryHandler { - public function handle(GetPayPalOrderForAdminViewQuery $query) + public function __invoke(GetPayPalOrderForAdminViewQuery $query) { return new GetPayPalOrderForAdminViewQueryResult(); } diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php index 256e36a68..4bb27075e 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php @@ -24,7 +24,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQueryResult; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; class GetPayPalOrderForCartIdQueryHandler { @@ -50,7 +50,7 @@ public function __construct(CacheInterface $orderPayPalCache, PsCheckoutCartRepo * * @throws PayPalOrderException */ - public function handle(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) + public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) { $psCheckoutCart = $this->checkoutCartRepository->findOneByCartId($getPayPalOrderQuery->getCartId()->getValue()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php index 6c4a439cc..5daab76aa 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php @@ -27,7 +27,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; /** * We need to know if the Order Status is APPROVED and in case of Card payment if 3D Secure allow to capture @@ -44,7 +44,7 @@ public function __construct(CacheInterface $orderPayPalCache) $this->orderPayPalCache = $orderPayPalCache; } - public function handle(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrderQuery) + public function __invoke(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrderQuery) { /** @var array{id: string, status: string} $order */ $order = $this->orderPayPalCache->get($getPayPalOrderQuery->getOrderPayPalId()->getValue()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php index 9e536a942..82ad1ea4d 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php @@ -25,7 +25,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQueryResult; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; class GetPayPalOrderForOrderConfirmationQueryHandler { @@ -39,7 +39,7 @@ public function __construct(CacheInterface $orderPayPalCache) $this->orderPayPalCache = $orderPayPalCache; } - public function handle(GetPayPalOrderForOrderConfirmationQuery $query) + public function __invoke(GetPayPalOrderForOrderConfirmationQuery $query) { /** @var array{id: string, status: string} $order */ $order = $this->orderPayPalCache->get($query->getOrderPayPalId()->getValue()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php index 2b1df02a4..201d08ceb 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderQueryHandler.php @@ -24,7 +24,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQueryResult; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; class GetPayPalOrderQueryHandler { @@ -50,7 +50,7 @@ public function __construct(CacheInterface $orderCache, PsCheckoutCartRepository * * @throws \PrestaShopException */ - public function handle(GetPayPalOrderQuery $query) + public function __invoke(GetPayPalOrderQuery $query) { $orderId = !$query->getOrderId()->getValue() ? null : $query->getOrderId()->getValue(); diff --git a/src/PayPal/PayPalOrderProvider.php b/src/PayPal/PayPalOrderProvider.php index d6a189ee5..0aa857695 100644 --- a/src/PayPal/PayPalOrderProvider.php +++ b/src/PayPal/PayPalOrderProvider.php @@ -21,7 +21,7 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; class PayPalOrderProvider { @@ -49,7 +49,7 @@ public function getById($id) return false; } - if ($this->orderPayPalCache->has($id)) { + if ($this->orderPayPalCache->hasItem($id)) { return $this->orderPayPalCache->get($id); } diff --git a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php index 99ce495cf..a5db09fa8 100644 --- a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php +++ b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php @@ -42,7 +42,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCapturePendingEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureReversedEvent; use Ps_checkout; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalCaptureEventSubscriber implements EventSubscriberInterface diff --git a/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php b/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php index 7705bcf80..3f6ef1edf 100644 --- a/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php +++ b/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php @@ -75,7 +75,7 @@ public function __construct( * @throws PayPalRefundFailedException * @throws PayPalOrderException */ - public function handle(RefundPayPalCaptureCommand $command) + public function __invoke(RefundPayPalCaptureCommand $command) { $response = $this->checkoutHttpClient->refundOrder([ 'orderId' => $command->getOrderPayPalId(), diff --git a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php index cfe2df3f2..2ffd9985e 100644 --- a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php +++ b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php @@ -31,7 +31,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalRefundEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; use Ps_checkout; -use Psr\SimpleCache\CacheInterface; +use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalRefundEventSubscriber implements EventSubscriberInterface @@ -95,7 +95,7 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) return; } - if ($this->orderPayPalCache->has($event->getPayPalOrderId()->getValue())) { + if ($this->orderPayPalCache->hasItem($event->getPayPalOrderId()->getValue())) { $this->orderPayPalCache->delete($event->getPayPalOrderId()->getValue()); } @@ -136,7 +136,7 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) public function updateCache(PayPalRefundEvent $event) { - if ($this->orderPayPalCache->has($event->getPayPalOrderId()->getValue())) { + if ($this->orderPayPalCache->hasItem($event->getPayPalOrderId()->getValue())) { $this->orderPayPalCache->delete($event->getPayPalOrderId()->getValue()); } } diff --git a/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php b/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php index 4635b7c35..2ad99ab3f 100644 --- a/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php +++ b/src/PayPal/PaymentToken/CommandHandler/DeletePaymentTokenCommandHandler.php @@ -43,7 +43,7 @@ public function __construct(PaymentMethodTokenService $paymentMethodTokenService /** * @throws Exception */ - public function handle(DeletePaymentTokenCommand $command) + public function __invoke(DeletePaymentTokenCommand $command) { $tokenBelongsToCustomer = false; $tokens = $this->paymentTokenRepository->findByPrestaShopCustomerId($command->getCustomerId()->getValue()); diff --git a/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php b/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php index 89724dcf4..a09b0637f 100644 --- a/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php +++ b/src/PayPal/PaymentToken/CommandHandler/SavePaymentTokenCommandHandler.php @@ -38,7 +38,7 @@ public function __construct(PaymentTokenRepository $paymentTokenRepository) /** * @throws Exception */ - public function handle(SavePaymentTokenCommand $command) + public function __invoke(SavePaymentTokenCommand $command) { $token = new PaymentToken( $command->getPaymentTokenId()->getValue(), diff --git a/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php b/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php index 4d5077d38..2bac9ce57 100644 --- a/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php +++ b/src/PayPal/PaymentToken/Query/GetCustomerPaymentTokensQueryHandler.php @@ -45,7 +45,7 @@ public function __construct(PaymentTokenRepository $paymentTokenRepository) * * @throws Exception */ - public function handle(GetCustomerPaymentTokensQuery $query) + public function __invoke(GetCustomerPaymentTokensQuery $query) { // $paymentTokens = $this->paymentTokenRepository->findByPrestaShopCustomerId($query->getCustomerId()->getValue(), $query->getPageSize(), $query->getPageNumber()); $paymentTokens = $this->paymentTokenRepository->findByPrestaShopCustomerId($query->getCustomerId()->getValue()); diff --git a/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php b/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php index 703d87c3f..9e7f230a6 100644 --- a/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php +++ b/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php @@ -28,6 +28,7 @@ use PrestaShop\Module\PrestashopCheckout\ExpressCheckout\ExpressCheckoutConfiguration; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceConfigurationRepository; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint; +use PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider; use PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryResult; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; @@ -69,10 +70,6 @@ class PayPalSdkConfigurationBuilder /** @var array */ private static $cache = []; - /** - * @var CommandBusInterface - */ - private $commandBus; /** * @var PrestaShopContext */ @@ -89,9 +86,9 @@ class PayPalSdkConfigurationBuilder * @var FundingSourceEligibilityConstraint */ private $fundingSourceEligibilityConstraint; + private PayPalCustomerIdProvider $payPalCustomerIdProvider; /** - * @param \Ps_checkout $module * @param Env $env * @param PayPalConfiguration $configuration * @param PayPalPayLaterConfiguration $payLaterConfiguration @@ -103,7 +100,6 @@ class PayPalSdkConfigurationBuilder * @param FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint */ public function __construct( - \Ps_checkout $module, Env $env, PayPalConfiguration $configuration, PayPalPayLaterConfiguration $payLaterConfiguration, @@ -112,18 +108,19 @@ public function __construct( ShopContext $shopContext, PrestaShopContext $prestaShopContext, LoggerInterface $logger, - FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint + FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint, + PayPalCustomerIdProvider $payPalCustomerIdProvider, ) { $this->configuration = $configuration; $this->payLaterConfiguration = $payLaterConfiguration; $this->fundingSourceConfigurationRepository = $fundingSourceConfigurationRepository; $this->expressCheckoutConfiguration = $expressCheckoutConfiguration; $this->shopContext = $shopContext; - $this->commandBus = $module->getService('ps_checkout.bus.command'); $this->prestaShopContext = $prestaShopContext; $this->logger = $logger; $this->env = $env; $this->fundingSourceEligibilityConstraint = $fundingSourceEligibilityConstraint; + $this->payPalCustomerIdProvider = $payPalCustomerIdProvider; } /** @@ -170,9 +167,7 @@ public function buildConfiguration() if ($this->configuration->isVaultingEnabled() && $this->prestaShopContext->customerIsLogged() && $this->prestaShopContext->getCustomerId() && 'order' === $this->getPageName()) { try { - /** @var GetPayPalGetUserIdTokenQueryResult $queryResult */ - $queryResult = $this->commandBus->handle(new GetPayPalGetUserIdTokenQuery(new CustomerId($this->prestaShopContext->getCustomerId()))); - $params['dataUserIdToken'] = $queryResult->getUserIdToken(); + $params['dataUserIdToken'] = $this->payPalCustomerIdProvider->getCustomerId(new CustomerId($this->prestaShopContext->getCustomerId())); } catch (Exception $exception) { $this->logger->error('Failed to get PayPal User ID token.', ['exception' => $exception]); } diff --git a/src/Repository/PsCheckoutCartRepository.php b/src/Repository/PsCheckoutCartRepository.php index f85866f7c..3a10e5cfd 100644 --- a/src/Repository/PsCheckoutCartRepository.php +++ b/src/Repository/PsCheckoutCartRepository.php @@ -22,7 +22,11 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Cache\CacheSettings; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; -use Psr\SimpleCache\CacheInterface; +use PrestaShopCollection; +use PrestaShopDatabaseException; +use PrestaShopException; +use PsCheckoutCart; +use Symfony\Contracts\Cache\CacheInterface; class PsCheckoutCartRepository { @@ -42,21 +46,21 @@ public function __construct(CacheInterface $cartPrestaShopCache) /** * @param int $cartId * - * @return \PsCheckoutCart|false + * @return PsCheckoutCart|false * - * @throws \PrestaShopException + * @throws PrestaShopException */ public function findOneByCartId($cartId) { - if ($this->cartPrestaShopCache->has(CacheSettings::CART_ID . $cartId)) { + if ($this->cartPrestaShopCache->hasItem(CacheSettings::CART_ID . $cartId)) { return $this->cartPrestaShopCache->get(CacheSettings::CART_ID . $cartId); } - $psCheckoutCartCollection = new \PrestaShopCollection('PsCheckoutCart'); + $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); $psCheckoutCartCollection->where('id_cart', '=', (int) $cartId); $psCheckoutCartCollection->orderBy('date_upd', 'desc'); - /** @var \PsCheckoutCart|false $psCheckoutCart */ + /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $psCheckoutCartCollection->getFirst(); if (false !== $psCheckoutCart) { @@ -72,20 +76,20 @@ public function findOneByCartId($cartId) /** * @param string $payPalOrderId * - * @return \PsCheckoutCart|false + * @return PsCheckoutCart|false * - * @throws \PrestaShopException + * @throws PrestaShopException */ public function findOneByPayPalOrderId($payPalOrderId) { - if ($this->cartPrestaShopCache->has(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId)) { + if ($this->cartPrestaShopCache->hasItem(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId)) { return $this->cartPrestaShopCache->get(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId); } - $psCheckoutCartCollection = new \PrestaShopCollection('PsCheckoutCart'); + $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); $psCheckoutCartCollection->where('paypal_order', '=', $payPalOrderId); - /** @var \PsCheckoutCart|false $psCheckoutCart */ + /** @var PsCheckoutCart|false $psCheckoutCart */ $psCheckoutCart = $psCheckoutCartCollection->getFirst(); if (false !== $psCheckoutCart) { @@ -99,13 +103,13 @@ public function findOneByPayPalOrderId($payPalOrderId) } /** - * @param \PsCheckoutCart $psCheckoutCart + * @param PsCheckoutCart $psCheckoutCart * * @return bool * - * @throws \PrestaShopDatabaseException + * @throws PrestaShopDatabaseException */ - public function save(\PsCheckoutCart $psCheckoutCart) + public function save(PsCheckoutCart $psCheckoutCart) { if (empty($psCheckoutCart->id_cart)) { throw new PsCheckoutException('No cart found.', PsCheckoutException::PRESTASHOP_CONTEXT_INVALID); @@ -124,13 +128,13 @@ public function save(\PsCheckoutCart $psCheckoutCart) } /** - * @param \PsCheckoutCart $psCheckoutCart + * @param PsCheckoutCart $psCheckoutCart * * @return bool * - * @throws \PrestaShopDatabaseException + * @throws PrestaShopDatabaseException */ - public function remove(\PsCheckoutCart $psCheckoutCart) + public function remove(PsCheckoutCart $psCheckoutCart) { if (empty($psCheckoutCart->id_cart)) { throw new PsCheckoutException('No cart found.', PsCheckoutException::PRESTASHOP_CONTEXT_INVALID); diff --git a/src/Webhook/WebhookEventConfigurationUpdatedHandler.php b/src/Webhook/WebhookEventConfigurationUpdatedHandler.php index a01b56ec5..72719f45e 100644 --- a/src/Webhook/WebhookEventConfigurationUpdatedHandler.php +++ b/src/Webhook/WebhookEventConfigurationUpdatedHandler.php @@ -56,7 +56,7 @@ public function supports(array $payload) * @throws WebhookException * @throws PsCheckoutException */ - public function handle(array $payload) + public function __invoke(array $payload) { $this->assertPayloadIsValid($payload); diff --git a/src/Webhook/WebhookHandler.php b/src/Webhook/WebhookHandler.php index ebc78e630..45e41821f 100644 --- a/src/Webhook/WebhookHandler.php +++ b/src/Webhook/WebhookHandler.php @@ -59,7 +59,7 @@ public function authenticate($secret) * * @throws WebhookException */ - public function handle(array $payload) + public function __invoke(array $payload) { foreach ($this->webhookEventHandlers as $handler) { if ($handler->supports($payload)) { From 1bfb530572a53148a7c2aeb534202601901ddef0 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Mon, 30 Dec 2024 14:45:01 +0200 Subject: [PATCH 04/38] Semi-working order workflow --- config/command-handlers.yml | 17 +-- config/common.yml | 87 +++++++++---- controllers/front/applepay.php | 9 +- controllers/front/create.php | 9 +- controllers/front/googlepay.php | 9 +- controllers/front/validate.php | 6 +- controllers/front/vault.php | 5 +- ps_checkout.php | 2 - .../SaveCheckoutCommandHandler.php | 2 +- .../SavePayPalOrderStatusCommandHandler.php | 7 +- ...atePaymentMethodSelectedCommandHandler.php | 7 +- .../CheckoutEventSubscriber.php | 69 +++++----- src/CommandBus/TacticianQueryBusAdapter.php | 8 ++ src/CommandBus/TacticianQueryBusFactory.php | 8 ++ .../AddOrderPaymentCommandHandler.php | 16 +-- .../CreateOrderCommandHandler.php | 21 ++-- .../UpdateOrderStatusCommandHandler.php | 18 ++- .../EventSubscriber/OrderEventSubscriber.php | 26 ++-- .../UpdateOrderMatriceCommandHandler.php | 7 +- .../CapturePayPalOrderCommandHandler.php | 8 +- .../CreatePayPalOrderCommandHandler.php | 49 ++++---- .../SavePayPalOrderCommandHandler.php | 5 + .../UpdatePayPalOrderCommandHandler.php | 20 +-- .../PayPalOrderEventSubscriber.php | 118 ++++++++---------- src/PayPal/Order/PayPalOrderPresenter.php | 7 +- .../GetPayPalOrderForCartIdQueryHandler.php | 8 +- ...lOrderForCheckoutCompletedQueryHandler.php | 14 ++- ...lOrderForOrderConfirmationQueryHandler.php | 4 +- src/PayPal/PayPalOrderProvider.php | 23 ++-- .../PayPalCaptureEventSubscriber.php | 84 ++++++------- .../RefundPayPalCaptureCommandHandler.php | 28 +++-- .../PayPalRefundEventSubscriber.php | 43 ++----- .../PaymentMethodTokenEventSubscriber.php | 40 +++--- src/Repository/PsCheckoutCartRepository.php | 67 +++++++--- ...ebhookEventConfigurationUpdatedHandler.php | 2 +- 35 files changed, 460 insertions(+), 393 deletions(-) create mode 100644 src/CommandBus/TacticianQueryBusAdapter.php create mode 100644 src/CommandBus/TacticianQueryBusFactory.php diff --git a/config/command-handlers.yml b/config/command-handlers.yml index d980e6fd9..07e786b3d 100644 --- a/config/command-handlers.yml +++ b/config/command-handlers.yml @@ -3,7 +3,6 @@ services: class: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler' public: true arguments: - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' @@ -12,24 +11,20 @@ services: public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - "@ps_checkout.module" - '@PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount' - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider' + - '@PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber' PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler\UpdateOrderMatriceCommandHandler' public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler' @@ -38,27 +33,25 @@ services: - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' -# - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' - tags: - - { name: messenger.message_handler, bus: ps_checkout.bus.command } + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber' PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\UpdatePayPalOrderCommandHandler' public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' - '@PrestaShop\Module\PrestashopCheckout\ShopContext' - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber' PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler' public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + - '@ps_checkout.event.dispatcher.adapter2' - "@ps_checkout.cache.paypal.order" - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' @@ -97,7 +90,7 @@ services: - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - '@PrestaShop\Module\PrestashopCheckout\Configuration\PrestaShopConfiguration' - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - - '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber' PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler' diff --git a/config/common.yml b/config/common.yml index d600b0888..86f43e963 100644 --- a/config/common.yml +++ b/config/common.yml @@ -47,10 +47,15 @@ services: public: true factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] - app.command_handler_locator: - class: Symfony\Component\DependencyInjection\ServiceLocator - arguments: - - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CreatePayPalOrderCommandHandler' + ps_checkout.bus.command2: + class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusAdapter' + public: true + factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] + + ps_checkout.bus.query: + class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianQueryBusAdapter' + public: true + factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianQueryBusFactory', "create" ] PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory: class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory' @@ -69,25 +74,31 @@ services: PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler'] PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand: ['@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler'] PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\CommandHandler\RefundPayPalCaptureCommandHandler'] - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler'] - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentDeniedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler'] - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentPendingQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler'] - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler'] - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentReversedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler'] - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery: ['@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetCurrentPayPalOrderStatusQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler'] PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\SavePaymentTokenCommandHandler'] PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\CommandHandler\DeletePaymentTokenCommandHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler'] PrestaShop\Module\PrestashopCheckout\PayPal\Customer\Command\SavePayPalCustomerCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Customer\CommandHandler\SavePayPalCustomerCommandHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler'] PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand: ['@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler'] - PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery: ['@PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler'] + + PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianQueryBusFactory: + class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianQueryBusFactory' + public: true + arguments: + - "@ps_checkout.logger" + - PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentCompletedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentDeniedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentDeniedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentPendingQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentPendingQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentRefundedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentReversedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForPaymentReversedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery: [ '@PrestaShop\Module\PrestashopCheckout\Order\QueryHandler\GetOrderForApprovalReversedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCartIdQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetCurrentPayPalOrderStatusQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetCurrentPayPalOrderStatusQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForCheckoutCompletedQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForOrderConfirmationQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\QueryHandler\GetPayPalOrderForOrderConfirmationQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\Query\GetPayPalGetUserIdTokenQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQueryHandler' ] + PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery: [ '@PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQueryHandler' ] PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory: class: 'PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory' @@ -103,6 +114,10 @@ services: - '@PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' - '@ps_checkout.module' - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' + - '@ps_checkout.bus.query' + - '@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler' PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber: class: 'PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber' @@ -110,15 +125,12 @@ services: arguments: - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - '@ps_checkout.module' - calls: - - method: setCommandBus - arguments: [ '@ps_checkout.bus.command' ] PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber' public: true arguments: - - "@ps_checkout.module" + - "@ps_checkout.bus.query" - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - "@ps_checkout.cache.paypal.order" - '@PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' @@ -126,29 +138,37 @@ services: - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber' public: true arguments: - - '@ps_checkout.module' - '@PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount' - "@ps_checkout.cache.paypal.capture" - "@ps_checkout.cache.paypal.order" - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' + - '@ps_checkout.bus.query' + - '@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler' + - '@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber' arguments: - - '@ps_checkout.module' - '@ps_checkout.cache.paypal.order' - '@PrestaShop\Module\PrestashopCheckout\Order\State\Service\OrderStateMapper' - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider' + - '@ps_checkout.bus.query' + - '@PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler' PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber: class: 'PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber' arguments: - - '@ps_checkout.module' - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository' - '@PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository' @@ -165,12 +185,27 @@ services: '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber' ] + ps_checkout.event.dispatcher.symfony2: + class: 'Symfony\Component\EventDispatcher\EventDispatcherInterface' + factory: [ '@PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherFactory', "create" ] + arguments: + - [ + '@PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber\PayPalCaptureEventSubscriber', + '@PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber\PaymentMethodTokenEventSubscriber' + ] + PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter: class: 'PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' public: true arguments: - "@ps_checkout.event.dispatcher.symfony" + ps_checkout.event.dispatcher.adapter2: + class: 'PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter' + public: true + arguments: + - "@ps_checkout.event.dispatcher.symfony2" + PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext: class: 'PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' public: true diff --git a/controllers/front/applepay.php b/controllers/front/applepay.php index f74fea18c..1c31f965b 100644 --- a/controllers/front/applepay.php +++ b/controllers/front/applepay.php @@ -35,10 +35,9 @@ class Ps_CheckoutApplepayModuleFrontController extends AbstractFrontController */ public $module; - /** - * @var CommandBusInterface - */ - private $commandBus; + private CommandBusInterface $commandBus; + + private CommandBusInterface $queryBus; /** * @see FrontController::postProcess() @@ -105,7 +104,7 @@ private function getPaymentRequest() { $cartId = new CartId($this->context->cart->id); $query = new GetApplePayPaymentRequestQuery($cartId); - $paymentRequest = $this->commandBus->handle($query); + $paymentRequest = $this->queryBus->handle($query); $this->exitWithResponse([ 'httpCode' => 200, diff --git a/controllers/front/create.php b/controllers/front/create.php index 0ff7a6125..bb701b610 100755 --- a/controllers/front/create.php +++ b/controllers/front/create.php @@ -128,13 +128,14 @@ public function postProcess() /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); - $commandBus->handle(new CreatePayPalOrderCommand($cartId, $fundingSource, $isCardFields, $isExpressCheckout, $vaultId, $favorite, $vault)); - /** @var \PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface $eventDispatcher */ - $eventDispatcher = $this->module->getService('ps_checkout.event_dispatcher'); + /** @var CommandBusInterface $queryBus */ + $queryBus = $this->module->getService('ps_checkout.bus.query'); + + $commandBus->handle(new CreatePayPalOrderCommand($cartId, $fundingSource, $isCardFields, $isExpressCheckout, $vaultId, $favorite, $vault)); /** @var GetPayPalOrderForCartIdQueryResult $getPayPalOrderForCartIdQueryResult */ - $getPayPalOrderForCartIdQueryResult = $commandBus->handle(new GetPayPalOrderForCartIdQuery($cartId)); + $getPayPalOrderForCartIdQueryResult = $queryBus->handle(new GetPayPalOrderForCartIdQuery($cartId)); $order = $getPayPalOrderForCartIdQueryResult->getOrder(); $this->exitWithResponse([ diff --git a/controllers/front/googlepay.php b/controllers/front/googlepay.php index 7734798cc..c6bda3945 100644 --- a/controllers/front/googlepay.php +++ b/controllers/front/googlepay.php @@ -33,10 +33,7 @@ class Ps_CheckoutGooglepayModuleFrontController extends AbstractFrontController */ public $module; - /** - * @var CommandBusInterface - */ - private $commandBus; + private CommandBusInterface $queryBus; /** * @see FrontController::postProcess() @@ -53,7 +50,7 @@ public function postProcess() $action = $bodyValues['action']; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $this->module->getService('ps_checkout.bus.query'); if ($action === 'getTransactionInfo') { $this->getTransactionInfo($bodyValues); @@ -67,7 +64,7 @@ public function postProcess() private function getTransactionInfo(array $bodyValues) { - $transactionInfo = $this->commandBus->handle(new GetGooglePayTransactionInfoQuery(new CartId($this->context->cart->id))); + $transactionInfo = $this->queryBus->handle(new GetGooglePayTransactionInfoQuery(new CartId($this->context->cart->id))); $this->exitWithResponse([ 'httpCode' => 200, diff --git a/controllers/front/validate.php b/controllers/front/validate.php index f6cb2fa30..c4c18a00e 100644 --- a/controllers/front/validate.php +++ b/controllers/front/validate.php @@ -126,8 +126,8 @@ private function generateResponse() } try { - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->module->getService('ps_checkout.bus.command'); + /** @var CommandBusInterface $queryBus */ + $queryBus = $this->module->getService('ps_checkout.bus.query'); /** @var PsCheckoutCartRepository $psCheckoutCartRepository */ $psCheckoutCartRepository = $this->module->getService(PsCheckoutCartRepository::class); @@ -141,7 +141,7 @@ private function generateResponse() try { /** @var GetPayPalOrderForOrderConfirmationQueryResult $paypalOrder */ - $paypalOrder = $commandBus->handle(new GetPayPalOrderForOrderConfirmationQuery( + $paypalOrder = $queryBus->handle(new GetPayPalOrderForOrderConfirmationQuery( $psCheckoutCart->paypal_order )); } catch (Exception $exception) { diff --git a/controllers/front/vault.php b/controllers/front/vault.php index f45a24c67..fa1ebb52f 100644 --- a/controllers/front/vault.php +++ b/controllers/front/vault.php @@ -40,6 +40,9 @@ public function postProcess() /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); + /** @var CommandBusInterface $queryBus */ + $queryBus = $this->module->getService('ps_checkout.bus.query'); + $bodyValues = []; $bodyContent = file_get_contents('php://input'); @@ -70,7 +73,7 @@ public function postProcess() } /** @var GetCustomerPaymentTokensQueryResult $getCustomerPaymentMethodTokensQueryResult */ - $getCustomerPaymentMethodTokensQueryResult = $commandBus->handle(new GetCustomerPaymentTokensQuery( + $getCustomerPaymentMethodTokensQueryResult = $queryBus->handle(new GetCustomerPaymentTokensQuery( $customerId, $this->getPageSize(), $this->getPageNumber() diff --git a/ps_checkout.php b/ps_checkout.php index 562608b9f..9b274a7ce 100755 --- a/ps_checkout.php +++ b/ps_checkout.php @@ -937,8 +937,6 @@ public function hookActionFrontControllerSetMedia() if (false === $frontControllerValidator->shouldLoadFrontJS($controller)) { return; } -// $sfContainer = PrestaShop\PrestaShop\Adapter\SymfonyContainer::getInstance(); - $commandBus = $this->get('prestashop.core.filter.front_end_object.main'); /** @var \PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder $payPalSdkConfigurationBuilder */ $payPalSdkConfigurationBuilder = $this->getService(\PrestaShop\Module\PrestashopCheckout\PayPal\Sdk\PayPalSdkConfigurationBuilder::class); diff --git a/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php b/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php index 4aa593ef3..3855f1bbb 100644 --- a/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php +++ b/src/Checkout/CommandHandler/SaveCheckoutCommandHandler.php @@ -43,7 +43,7 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) * * @throws PsCheckoutSessionException */ - public function __invoke(SaveCheckoutCommand $command) + public function handle(SaveCheckoutCommand $command) { try { /** @var PsCheckoutCart|false $psCheckoutCart */ diff --git a/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php b/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php index 8644549c5..7b1c0050d 100644 --- a/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php +++ b/src/Checkout/CommandHandler/SavePayPalOrderStatusCommandHandler.php @@ -45,12 +45,17 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository, $this->payPalOrderRepository = $payPalOrderRepository; } + public function __invoke(SavePayPalOrderStatusCommand $command) + { + $this->handle($command); + } + /** * @param SavePayPalOrderStatusCommand $command * * @throws PsCheckoutSessionException */ - public function __invoke(SavePayPalOrderStatusCommand $command) + public function handle(SavePayPalOrderStatusCommand $command) { // TODO: To be repurposed try { diff --git a/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php b/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php index ce6e51a5c..c944756d0 100644 --- a/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php +++ b/src/Checkout/CommandHandler/UpdatePaymentMethodSelectedCommandHandler.php @@ -39,12 +39,17 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) $this->psCheckoutCartRepository = $psCheckoutCartRepository; } + public function __invoke(UpdatePaymentMethodSelectedCommand $command) + { + $this->handle($command); + } + /** * @param UpdatePaymentMethodSelectedCommand $command * * @throws PsCheckoutSessionException */ - public function __invoke(UpdatePaymentMethodSelectedCommand $command) + public function handle(UpdatePaymentMethodSelectedCommand $command) { try { /** @var PsCheckoutCart|false $psCheckoutCart */ diff --git a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php index ff244da6e..e7a836da2 100644 --- a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php +++ b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php @@ -23,13 +23,16 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker; use PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand; +use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler; use PrestaShop\Module\PrestashopCheckout\Checkout\Event\CheckoutCompletedEvent; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\Exception\HttpTimeoutException; use PrestaShop\Module\PrestashopCheckout\Exception\PayPalException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; @@ -43,31 +46,30 @@ class CheckoutEventSubscriber implements EventSubscriberInterface { - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var CommandBusInterface - */ - private $commandBus; - - /** - * @var CheckoutChecker - */ - private $checkoutChecker; - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - public function __construct(CheckoutChecker $checkoutChecker, Ps_checkout $module, PsCheckoutCartRepository $psCheckoutCartRepository) - { + private Ps_checkout $module; + private CommandBusInterface $queryBus; + private CheckoutChecker $checkoutChecker; + private PsCheckoutCartRepository $psCheckoutCartRepository; + private UpdatePaymentMethodSelectedCommandHandler $updatePaymentMethodSelectedCommandHandler; + private CreateOrderCommandHandler $createOrderCommandHandler; + private CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler; + + public function __construct( + CheckoutChecker $checkoutChecker, + Ps_checkout $module, + PsCheckoutCartRepository $psCheckoutCartRepository, + CommandBusInterface $queryBus, + UpdatePaymentMethodSelectedCommandHandler $updatePaymentMethodSelectedCommandHandler, + CreateOrderCommandHandler $createOrderCommandHandler, + CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler + ) { $this->checkoutChecker = $checkoutChecker; $this->module = $module; $this->psCheckoutCartRepository = $psCheckoutCartRepository; -// $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $queryBus; + $this->updatePaymentMethodSelectedCommandHandler = $updatePaymentMethodSelectedCommandHandler; + $this->createOrderCommandHandler = $createOrderCommandHandler; + $this->capturePayPalOrderCommandHandler = $capturePayPalOrderCommandHandler; } /** @@ -98,7 +100,7 @@ public static function getSubscribedEvents() */ public function updatePaymentMethodSelected(CheckoutCompletedEvent $event) { - $this->commandBus->handle(new UpdatePaymentMethodSelectedCommand( + $this->updatePaymentMethodSelectedCommandHandler->handle(new UpdatePaymentMethodSelectedCommand( $event->getCartId()->getValue(), $event->getPayPalOrderId()->getValue(), $event->getFundingSource(), @@ -124,27 +126,26 @@ public function proceedToPayment(CheckoutCompletedEvent $event) { try { /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ - $getPayPalOrderForCheckoutCompletedQueryResult = $this->commandBus->handle(new GetPayPalOrderForCheckoutCompletedQuery( + $getPayPalOrderForCheckoutCompletedQueryResult = $this->queryBus->handle(new GetPayPalOrderForCheckoutCompletedQuery( $event->getPayPalOrderId()->getValue() )); } catch (HttpTimeoutException $exception) { - $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); - + $this->createOrderCommandHandler->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); return; } $this->checkoutChecker->continueWithAuthorization($event->getCartId()->getValue(), $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder()); try { -// $this->commandBus->handle( -// new CapturePayPalOrderCommand( -// $event->getPayPalOrderId()->getValue(), -// $event->getFundingSource() -// ) -// ); + $this->capturePayPalOrderCommandHandler->handle( + new CapturePayPalOrderCommand( + $event->getPayPalOrderId()->getValue(), + $event->getFundingSource() + ) + ); } catch (PayPalException $exception) { if ($exception->getCode() === PayPalException::ORDER_NOT_APPROVED) { - $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); + $this->createOrderCommandHandler->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); return; } elseif ($exception->getCode() === PayPalException::RESOURCE_NOT_FOUND) { @@ -162,7 +163,7 @@ public function proceedToPayment(CheckoutCompletedEvent $event) throw $exception; } } catch (HttpTimeoutException $exception) { -// $this->commandBus->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); + $this->createOrderCommandHandler->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); return; } diff --git a/src/CommandBus/TacticianQueryBusAdapter.php b/src/CommandBus/TacticianQueryBusAdapter.php new file mode 100644 index 000000000..eae008fab --- /dev/null +++ b/src/CommandBus/TacticianQueryBusAdapter.php @@ -0,0 +1,8 @@ +eventDispatcher = $eventDispatcher; $this->fundingSourceTranslationProvider = $fundingSourceTranslationProvider; $this->configuration = $configuration; } + public function __invoke(AddOrderPaymentCommand $command) { + $this->handle($command); + } + /** * @param AddOrderPaymentCommand $command * * @throws OrderException * @throws OrderPaymentException */ - public function __invoke(AddOrderPaymentCommand $command) + public function handle(AddOrderPaymentCommand $command) { $order = $this->getOrder($command->getOrderId()); $currency = Currency::getCurrencyInstance($command->getPaymentCurrencyId()); @@ -100,6 +96,6 @@ public function __invoke(AddOrderPaymentCommand $command) $orderPayments = $order->getOrderPayments(); $latestOrderPayment = end($orderPayments); - $this->eventDispatcher->dispatch(new OrderPaymentCreatedEvent((int) $latestOrderPayment->id)); +// $this->eventDispatcher->dispatch(new OrderPaymentCreatedEvent((int) $latestOrderPayment->id)); } } diff --git a/src/Order/CommandHandler/CreateOrderCommandHandler.php b/src/Order/CommandHandler/CreateOrderCommandHandler.php index 0c83aead2..974faf785 100644 --- a/src/Order/CommandHandler/CreateOrderCommandHandler.php +++ b/src/Order/CommandHandler/CreateOrderCommandHandler.php @@ -31,6 +31,7 @@ use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderCreatedEvent; +use PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber\OrderEventSubscriber; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Service\CheckOrderAmount; @@ -48,11 +49,6 @@ class CreateOrderCommandHandler extends AbstractOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - /** * @var ContextStateManager */ @@ -81,23 +77,28 @@ class CreateOrderCommandHandler extends AbstractOrderCommandHandler * @var FundingSourceTranslationProvider */ private $fundingSourceTranslationProvider; + private OrderEventSubscriber $orderEventSubscriber; public function __construct( ContextStateManager $contextStateManager, - EventDispatcherInterface $eventDispatcher, PsCheckoutCartRepository $psCheckoutCartRepository, OrderStateMapper $psOrderStateMapper, Ps_checkout $module, CheckOrderAmount $checkOrderAmount, - FundingSourceTranslationProvider $fundingSourceTranslationProvider + FundingSourceTranslationProvider $fundingSourceTranslationProvider, + OrderEventSubscriber $orderEventSubscriber ) { $this->contextStateManager = $contextStateManager; - $this->eventDispatcher = $eventDispatcher; $this->psCheckoutCartRepository = $psCheckoutCartRepository; $this->psOrderStateMapper = $psOrderStateMapper; $this->module = $module; $this->checkOrderAmount = $checkOrderAmount; $this->fundingSourceTranslationProvider = $fundingSourceTranslationProvider; + $this->orderEventSubscriber = $orderEventSubscriber; + } + + public function __invoke(CreateOrderCommand $command) { + $this->handle($command); } /** @@ -112,7 +113,7 @@ public function __construct( * @throws PrestaShopException * @throws PsCheckoutException */ - public function __invoke(CreateOrderCommand $command) + public function handle(CreateOrderCommand $command) { /** @var PsCheckoutCart $psCheckoutCart */ $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($command->getOrderPayPalId()->getValue()); @@ -209,7 +210,7 @@ public function __invoke(CreateOrderCommand $command) } foreach ($orders as $order) { - $this->eventDispatcher->dispatch(new OrderCreatedEvent((int) $order->id, (int) $cart->id)); + $this->orderEventSubscriber->updateOrderMatrice(new OrderCreatedEvent((int) $order->id, (int) $cart->id)); } } } diff --git a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php index 451a21ab1..afc1f6166 100644 --- a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php +++ b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php @@ -23,22 +23,18 @@ use Exception; use OrderHistory; use OrderState; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; -use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderStatusUpdatedEvent; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; use PrestaShop\Module\PrestashopCheckout\Order\State\ValueObject\OrderStateId; class UpdateOrderStatusCommandHandler extends AbstractOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - - public function __construct(EventDispatcherInterface $eventDispatcher) + public function __construct() { - $this->eventDispatcher = $eventDispatcher; + } + + public function __invoke(UpdateOrderStatusCommand $command) { + $this->handle($command); } /** @@ -48,7 +44,7 @@ public function __construct(EventDispatcherInterface $eventDispatcher) * * @throws OrderException */ - public function __invoke(UpdateOrderStatusCommand $command) + public function handle(UpdateOrderStatusCommand $command) { $order = $this->getOrder($command->getOrderId()); $orderCurrentState = (int) $order->getCurrentState(); @@ -80,7 +76,7 @@ public function __invoke(UpdateOrderStatusCommand $command) throw new OrderException(sprintf('Failed to update status or send email when changing OrderState #%d of Order #%d.', $command->getNewOrderStatusId()->getValue(), $command->getOrderId()->getValue()), OrderException::FAILED_UPDATE_ORDER_STATUS); } - $this->eventDispatcher->dispatch(new OrderStatusUpdatedEvent($orderStateId)); +// $this->eventDispatcher->dispatch(new OrderStatusUpdatedEvent($orderStateId)); } /** diff --git a/src/Order/EventSubscriber/OrderEventSubscriber.php b/src/Order/EventSubscriber/OrderEventSubscriber.php index 9a98c051c..a757b0ae0 100644 --- a/src/Order/EventSubscriber/OrderEventSubscriber.php +++ b/src/Order/EventSubscriber/OrderEventSubscriber.php @@ -21,10 +21,8 @@ namespace PrestaShop\Module\PrestashopCheckout\Order\EventSubscriber; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Event\OrderCreatedEvent; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderException; -use PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; use PrestaShopException; @@ -37,20 +35,10 @@ class OrderEventSubscriber implements EventSubscriberInterface * @var PsCheckoutCartRepository */ private $psCheckoutCartRepository; - /** - * @var CommandBusInterface - */ - private $commandBus; public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository, Ps_checkout $module) { $this->psCheckoutCartRepository = $psCheckoutCartRepository; -// $this->commandBus = $module->getService('ps_checkout.bus.command'); - } - - public function setCommandBus(CommandBusInterface $commandBus) - { - $this->commandBus = $commandBus; } /** @@ -77,9 +65,15 @@ public function updateOrderMatrice(OrderCreatedEvent $event) $cartId = $event->getCartId()->getValue(); $psCheckoutCart = $this->psCheckoutCartRepository->findOneByCartId($cartId); - $this->commandBus->handle(new UpdateOrderMatriceCommand( - $event->getOrderId()->getValue(), - $psCheckoutCart->getPaypalOrderId() - )); + $orderMatrice = new \OrderMatrice(); + $orderMatrice->id_order_prestashop = $event->getOrderId()->getValue(); + $orderMatrice->id_order_paypal = $psCheckoutCart->getPaypalOrderId(); + + $orderMatrice->add(); + +// $this->commandBus->handle(new UpdateOrderMatriceCommand( +// $event->getOrderId()->getValue(), +// $psCheckoutCart->getPaypalOrderId() +// )); } } diff --git a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php index 0e18cfd22..a4f886f50 100644 --- a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php +++ b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php @@ -26,11 +26,8 @@ class UpdateOrderMatriceCommandHandler { - private $eventDispatcher; - - public function __construct(EventDispatcherInterface $eventDispatcher) + public function __construct() { - $this->eventDispatcher = $eventDispatcher; } /** @@ -46,7 +43,7 @@ public function __invoke(UpdateOrderMatriceCommand $command) $res = $orderMatrice->add(); if (!empty($res)) { - $this->eventDispatcher->dispatch(new OrderMatriceUpdatedEvent()); +// $this->eventDispatcher->dispatch(new OrderMatriceUpdatedEvent()); } } } diff --git a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php index c23f20f2b..6bdc7270b 100644 --- a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php @@ -88,7 +88,11 @@ public function __construct( $this->payPalOrderRepository = $payPalOrderRepository; } - public function __invoke(CapturePayPalOrderCommand $capturePayPalOrderCommand) + public function __invoke(CapturePayPalOrderCommand $capturePayPalOrderCommand) { + $this->handle($capturePayPalOrderCommand); + } + + public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) { $context = Context::getContext(); $merchantId = Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT', null, null, $context->shop->id); @@ -109,7 +113,7 @@ public function __invoke(CapturePayPalOrderCommand $capturePayPalOrderCommand) $orderPayPal = json_decode($response->getBody(), true); - $payPalOrderFromCache = $this->orderPayPalCache->get($orderPayPal['id']); + $payPalOrderFromCache = $this->orderPayPalCache->getItem($orderPayPal['id'])->get(); $orderPayPal = array_replace_recursive($payPalOrderFromCache, $orderPayPal); diff --git a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php index fecd3504d..f623f2a01 100644 --- a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php @@ -26,7 +26,6 @@ use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; -use PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter; use PrestaShop\Module\PrestashopCheckout\Exception\InvalidRequestException; use PrestaShop\Module\PrestashopCheckout\Exception\NotAuthorizedException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; @@ -35,6 +34,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCreatedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\Presenter\Cart\CartPresenter; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; @@ -47,10 +47,6 @@ class CreatePayPalOrderCommandHandler * @var MaaslandHttpClient */ private $maaslandHttpClient; - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; /** * @var PayPalCustomerRepository */ @@ -67,27 +63,34 @@ class CreatePayPalOrderCommandHandler * @var PrestaShopContext */ private $prestaShopContext; + private PayPalOrderEventSubscriber $payPalOrderEventSubscriber; public function __construct( MaaslandHttpClient $maaslandHttpClient, ShopContext $shopContext, PrestaShopContext $prestaShopContext, -// EventDispatcherInterface $eventDispatcher, PayPalCustomerRepository $payPalCustomerRepository, - PaymentTokenRepository $paymentTokenRepository + PaymentTokenRepository $paymentTokenRepository, + PayPalOrderEventSubscriber $payPalOrderEventSubscriber ) { $this->maaslandHttpClient = $maaslandHttpClient; $this->shopContext = $shopContext; -// $this->eventDispatcher = $eventDispatcher; $this->payPalCustomerRepository = $payPalCustomerRepository; $this->paymentTokenRepository = $paymentTokenRepository; $this->prestaShopContext = $prestaShopContext; + $this->payPalOrderEventSubscriber = $payPalOrderEventSubscriber; + } + + public function __invoke(CreatePayPalOrderCommand $command) + { + $this->handle($command); } /** * @param CreatePayPalOrderCommand $command * * @return void + * @return void * * @throws CartNotFoundException * @throws PayPalOrderException @@ -96,13 +99,11 @@ public function __construct( * @throws UnprocessableEntityException * @throws Exception * @throws PsCheckoutException - * - * @return void */ - public function __invoke(CreatePayPalOrderCommand $command) + public function handle(CreatePayPalOrderCommand $command) { - $cartPresenter = (new CartPresenter())->present(); - $builder = new OrderPayloadBuilder($cartPresenter); + $cartPresenter = new CartPresenter(); + $builder = new OrderPayloadBuilder($cartPresenter->present()); try { $customerId = $this->prestaShopContext->getCustomerId(); @@ -153,15 +154,17 @@ public function __invoke(CreatePayPalOrderCommand $command) $customerIntent[] = PayPalOrder::CUSTOMER_INTENT_FAVORITE; } -// $this->eventDispatcher->dispatch(new PayPalOrderCreatedEvent( -// $order['id'], -// $order, -// $command->getCartId()->getValue(), -// $command->getFundingSource(), -// $command->isHostedFields(), -// $command->isExpressCheckout(), -// $customerIntent, -// $command->getPaymentTokenId() -// )); + $event = new PayPalOrderCreatedEvent( + $order['id'], + $order, + $command->getCartId()->getValue(), + $command->getFundingSource(), + $command->isHostedFields(), + $command->isExpressCheckout(), + $customerIntent, + $command->getPaymentTokenId() + ); + $this->payPalOrderEventSubscriber->saveCreatedPayPalOrder($event); + $this->payPalOrderEventSubscriber->updateCache($event); } } diff --git a/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php index 56a24e1a5..a589fe332 100644 --- a/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/SavePayPalOrderCommandHandler.php @@ -43,6 +43,11 @@ public function __construct(PayPalOrderRepository $payPalOrderRepository) } public function __invoke(SavePayPalOrderCommand $command) + { + $this->handle($command); + } + + public function handle(SavePayPalOrderCommand $command) { $order = $command->getOrder(); diff --git a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php index e671cbf0b..3e3cfdbd8 100644 --- a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php @@ -29,6 +29,7 @@ use PrestaShop\Module\PrestashopCheckout\Http\MaaslandHttpClient; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\UpdatePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderUpdatedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\EventSubscriber\PayPalOrderEventSubscriber; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; use PrestaShop\Module\PrestashopCheckout\Presenter\Cart\CartPresenter; @@ -36,11 +37,6 @@ class UpdatePayPalOrderCommandHandler { - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - /** * @var MaaslandHttpClient */ @@ -55,6 +51,7 @@ class UpdatePayPalOrderCommandHandler * @var PayPalOrderProvider */ private $paypalOrderProvider; + private PayPalOrderEventSubscriber $payPalOrderEventSubscriber; /** * @param MaaslandHttpClient $httpClient @@ -64,14 +61,14 @@ class UpdatePayPalOrderCommandHandler */ public function __construct( MaaslandHttpClient $httpClient, - EventDispatcherInterface $eventDispatcher, ShopContext $shopContext, - PayPalOrderProvider $paypalOrderProvider + PayPalOrderProvider $paypalOrderProvider, + PayPalOrderEventSubscriber $payPalOrderEventSubscriber ) { $this->httpClient = $httpClient; - $this->eventDispatcher = $eventDispatcher; $this->shopContext = $shopContext; $this->paypalOrderProvider = $paypalOrderProvider; + $this->payPalOrderEventSubscriber = $payPalOrderEventSubscriber; } /** @@ -146,14 +143,17 @@ public function __invoke(UpdatePayPalOrderCommand $command) throw new PayPalOrderException('Failed to update PayPal Order', PayPalOrderException::PAYPAL_ORDER_UPDATE_FAILED); } - $this->eventDispatcher->dispatch(new PayPalOrderUpdatedEvent( + $event = new PayPalOrderUpdatedEvent( $command->getPayPalOrderId()->getValue(), $updatedPayPalOrder, $command->getCartId()->getValue(), $command->isHostedFields(), $command->isExpressCheckout(), $command->getFundingSource() - )); + ); + + $this->payPalOrderEventSubscriber->updatePayPalOrder($event); + $this->payPalOrderEventSubscriber->clearCache($event); } /** diff --git a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php index 18508b427..1dc91b9a2 100644 --- a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php +++ b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php @@ -25,9 +25,12 @@ use PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker; use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SaveCheckoutCommand; use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQuery; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForApprovalReversedQueryResult; @@ -36,6 +39,8 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CheckTransitionPayPalOrderStatusService; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\SavePayPalOrderCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\CapturePayPalOrderCommandHandler; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler\SavePayPalOrderCommandHandler; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderApprovalReversedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderApprovedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCompletedEvent; @@ -46,74 +51,53 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository; -use Ps_checkout; use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalOrderEventSubscriber implements EventSubscriberInterface { - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var PsCheckoutCartRepository - */ - private $psCheckoutCartRepository; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var CheckoutChecker - */ - private $checkoutChecker; - - /** - * @var CheckTransitionPayPalOrderStatusService - */ - private $checkTransitionPayPalOrderStatusService; - - /** - * @var OrderStateMapper - */ - private $orderStateMapper; - - /** - * @var CommandBusInterface - */ - private $commandBus; - /** - * @var PayPalConfiguration - */ - private $payPalConfiguration; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; + private PsCheckoutCartRepository $psCheckoutCartRepository; + private CacheInterface $orderPayPalCache; + private CheckoutChecker $checkoutChecker; + private CheckTransitionPayPalOrderStatusService $checkTransitionPayPalOrderStatusService; + private OrderStateMapper $orderStateMapper; + private PayPalConfiguration $payPalConfiguration; + private PayPalOrderRepository $payPalOrderRepository; + private SavePayPalOrderCommandHandler $savePayPalOrderCommandHandler; + private SaveCheckoutCommandHandler $saveCheckoutCommandHandler; + private SavePayPalOrderStatusCommandHandler $savePayPalOrderStatusCommandHandler; + private CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler; + private CommandBusInterface $queryBus; + private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler; public function __construct( - Ps_checkout $module, + CommandBusInterface $queryBus, PsCheckoutCartRepository $psCheckoutCartRepository, CacheInterface $orderPayPalCache, CheckoutChecker $checkoutChecker, CheckTransitionPayPalOrderStatusService $checkTransitionPayPalOrderStatusService, OrderStateMapper $orderStateMapper, PayPalConfiguration $payPalConfiguration, - PayPalOrderRepository $payPalOrderRepository + PayPalOrderRepository $payPalOrderRepository, + SavePayPalOrderCommandHandler $savePayPalOrderCommandHandler, + SaveCheckoutCommandHandler $saveCheckoutCommandHandler, + SavePayPalOrderStatusCommandHandler $savePayPalOrderStatusCommandHandler, + CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler, + UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler ) { - $this->module = $module; + $this->queryBus = $queryBus; $this->psCheckoutCartRepository = $psCheckoutCartRepository; $this->orderPayPalCache = $orderPayPalCache; $this->checkoutChecker = $checkoutChecker; $this->checkTransitionPayPalOrderStatusService = $checkTransitionPayPalOrderStatusService; $this->orderStateMapper = $orderStateMapper; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); $this->payPalConfiguration = $payPalConfiguration; $this->payPalOrderRepository = $payPalOrderRepository; + $this->savePayPalOrderCommandHandler = $savePayPalOrderCommandHandler; + $this->saveCheckoutCommandHandler = $saveCheckoutCommandHandler; + $this->savePayPalOrderStatusCommandHandler = $savePayPalOrderStatusCommandHandler; + $this->capturePayPalOrderCommandHandler = $capturePayPalOrderCommandHandler; + $this->updateOrderStatusCommandHandler = $updateOrderStatusCommandHandler; } /** @@ -151,13 +135,13 @@ public function saveCreatedPayPalOrder(PayPalOrderCreatedEvent $event) { $order = $event->getOrderPayPal(); - try { // NOT SURE WHAT SHOULD HAPPEN IF ORDER WITH THAT ID ALREADY EXISTS + try { $payPalOrder = $this->payPalOrderRepository->getPayPalOrderByCartId($event->getCartId()->getValue()); $this->payPalOrderRepository->deletePayPalOrder($payPalOrder->getId()); } catch (Exception $e) { } - $this->commandBus->handle(new SavePayPalOrderCommand( + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand( $order, $event->getCartId(), $event->getFundingSource(), @@ -168,7 +152,7 @@ public function saveCreatedPayPalOrder(PayPalOrderCreatedEvent $event) $event->getPaymentTokenId() )); - $this->commandBus->handle(new SaveCheckoutCommand( + $this->saveCheckoutCommandHandler->handle(new SaveCheckoutCommand( $event->getCartId()->getValue(), $event->getOrderPayPalId()->getValue(), $order['status'], @@ -193,11 +177,11 @@ public function saveApprovedPayPalOrder(PayPalOrderApprovedEvent $event) } try { - $this->commandBus->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); } catch (Exception $exception) { } - $this->commandBus->handle(new SavePayPalOrderStatusCommand( + $this->savePayPalOrderStatusCommandHandler->handle(new SavePayPalOrderStatusCommand( $event->getOrderPayPalId()->getValue(), PayPalOrderStatus::APPROVED )); @@ -216,11 +200,11 @@ public function saveCompletedPayPalOrder(PayPalOrderCompletedEvent $event) } try { - $this->commandBus->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand($event->getOrderPayPal())); } catch (Exception $exception) { } - $this->commandBus->handle(new SavePayPalOrderStatusCommand( + $this->savePayPalOrderStatusCommandHandler->handle(new SavePayPalOrderStatusCommand( $event->getOrderPayPalId()->getValue(), PayPalOrderStatus::COMPLETED )); @@ -238,7 +222,7 @@ public function saveApprovalReversedPayPalOrder(PayPalOrderApprovalReversedEvent return; } - $this->commandBus->handle(new SavePayPalOrderStatusCommand( + $this->savePayPalOrderStatusCommandHandler->handle(new SavePayPalOrderStatusCommand( $event->getOrderPayPalId()->getValue(), PayPalOrderStatus::REVERSED )); @@ -263,19 +247,17 @@ public function capturePayPalOrder(PayPalOrderApprovedEvent $event) $this->checkoutChecker->continueWithAuthorization($psCheckoutCart->getIdCart(), $event->getOrderPayPal()); - $this->commandBus->handle( - new CapturePayPalOrderCommand( - $event->getOrderPayPalId()->getValue(), - $psCheckoutCart->getPaypalFundingSource() - ) - ); + $this->capturePayPalOrderCommandHandler->handle( new CapturePayPalOrderCommand( + $event->getOrderPayPalId()->getValue(), + $psCheckoutCart->getPaypalFundingSource() + )); } public function setApprovalReversedOrderStatus(PayPalOrderApprovalReversedEvent $event) { try { /** @var GetOrderForApprovalReversedQueryResult $order */ - $order = $this->commandBus->handle( + $order = $this->queryBus->handle( new GetOrderForApprovalReversedQuery( $event->getOrderPayPalId()->getValue() ) @@ -288,7 +270,7 @@ public function setApprovalReversedOrderStatus(PayPalOrderApprovalReversedEvent return; } - $this->commandBus->handle( + $this->updateOrderStatusCommandHandler->handle( new UpdateOrderStatusCommand( $order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_CANCELED) @@ -298,19 +280,21 @@ public function setApprovalReversedOrderStatus(PayPalOrderApprovalReversedEvent public function updateCache(PayPalOrderEvent $event) { - $currentOrderPayPal = $this->orderPayPalCache->get($event->getOrderPayPalId()->getValue()); + $currentOrderPayPal = $this->orderPayPalCache->getItem($event->getOrderPayPalId()->getValue()); $newOrderPayPal = $event->getOrderPayPal(); - if ($currentOrderPayPal && !$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($currentOrderPayPal['status'], $newOrderPayPal['status'])) { + if ($currentOrderPayPal->get() && !$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($currentOrderPayPal->get()['status'], $newOrderPayPal['status'])) { return; } - $this->orderPayPalCache->set($event->getOrderPayPalId()->getValue(), $newOrderPayPal); + $currentOrderPayPal->set($newOrderPayPal); + $this->orderPayPalCache->save($currentOrderPayPal); +// $this->orderPayPalCache->set($event->getOrderPayPalId()->getValue(), $newOrderPayPal); } public function updatePayPalOrder(PayPalOrderEvent $event) { - $this->commandBus->handle(new SavePayPalOrderCommand( + $this->savePayPalOrderCommandHandler->handle(new SavePayPalOrderCommand( $event->getOrderPayPal() )); } diff --git a/src/PayPal/Order/PayPalOrderPresenter.php b/src/PayPal/Order/PayPalOrderPresenter.php index ecfae9266..3dcaea44f 100644 --- a/src/PayPal/Order/PayPalOrderPresenter.php +++ b/src/PayPal/Order/PayPalOrderPresenter.php @@ -22,7 +22,9 @@ use Currency; use PrestaShop\Module\PrestashopCheckout\PsCheckoutDataProvider; +use PrestaShop\PrestaShop\Core\Localization\CLDR\LocaleRepository; use Tools; +use PrestaShop\PrestaShop\Core\Localization\Locale; class PayPalOrderPresenter { @@ -95,10 +97,7 @@ public function getTotalAmountFormatted() return ''; } - return Tools::displayPrice( - (float) $this->paypalOrderDataProvider->getTotalAmount(), - Currency::getCurrencyInstance(Currency::getIdByIsoCode($this->paypalOrderDataProvider->getCurrencyCode())) - ); + return \Context::getContext()->getCurrentLocale()->formatPrice((float) $this->paypalOrderDataProvider->getTotalAmount(), $this->paypalOrderDataProvider->getCurrencyCode()); } /** diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php index 4bb27075e..d5eed7c71 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php @@ -43,6 +43,10 @@ public function __construct(CacheInterface $orderPayPalCache, PsCheckoutCartRepo $this->checkoutCartRepository = $checkoutCartRepository; } + public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) + { + return $this->handle($getPayPalOrderQuery); + } /** * @param GetPayPalOrderForCartIdQuery $getPayPalOrderQuery * @@ -50,12 +54,12 @@ public function __construct(CacheInterface $orderPayPalCache, PsCheckoutCartRepo * * @throws PayPalOrderException */ - public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) + public function handle(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) { $psCheckoutCart = $this->checkoutCartRepository->findOneByCartId($getPayPalOrderQuery->getCartId()->getValue()); /** @var array $order */ - $order = $this->orderPayPalCache->get($psCheckoutCart->getPaypalOrderId()); + $order = $this->orderPayPalCache->getItem($psCheckoutCart->getPaypalOrderId())->get(); if (empty($order)) { throw new PayPalOrderException('PayPal order not found', PayPalOrderException::CANNOT_RETRIEVE_ORDER); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php index 5daab76aa..703ea78c0 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php @@ -27,6 +27,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; +use PrestaShop\Module\PsAccounts\Vendor\Psr\Cache\CacheItemInterface; use Symfony\Contracts\Cache\CacheInterface; /** @@ -47,7 +48,13 @@ public function __construct(CacheInterface $orderPayPalCache) public function __invoke(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrderQuery) { /** @var array{id: string, status: string} $order */ - $order = $this->orderPayPalCache->get($getPayPalOrderQuery->getOrderPayPalId()->getValue()); + $order = $this->orderPayPalCache->get( + $getPayPalOrderQuery->getOrderPayPalId()->getValue(), + function(CacheItemInterface $cacheItem) use ($getPayPalOrderQuery) { + $cacheItem->expiresAfter(60); + return new PaypalOrder($getPayPalOrderQuery->getOrderPayPalId()->getValue()); + } + ); if (!empty($order) && $order['status'] === 'APPROVED') { return new GetPayPalOrderForCheckoutCompletedQueryResult($order); @@ -55,7 +62,10 @@ public function __invoke(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrder try { $orderPayPal = new PaypalOrder($getPayPalOrderQuery->getOrderPayPalId()->getValue()); - $this->orderPayPalCache->set($getPayPalOrderQuery->getOrderPayPalId()->getValue(), $orderPayPal->getOrder()); + $cacheItem = $this->orderPayPalCache->getItem($getPayPalOrderQuery->getOrderPayPalId()->getValue()); + $cacheItem->set($orderPayPal->getOrder()); + $this->orderPayPalCache->save($cacheItem); +// $this->orderPayPalCache->set($getPayPalOrderQuery->getOrderPayPalId()->getValue(), $orderPayPal->getOrder()); } catch (HttpTimeoutException $exception) { throw $exception; } catch (Exception $exception) { diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php index 82ad1ea4d..672f44375 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForOrderConfirmationQueryHandler.php @@ -42,7 +42,9 @@ public function __construct(CacheInterface $orderPayPalCache) public function __invoke(GetPayPalOrderForOrderConfirmationQuery $query) { /** @var array{id: string, status: string} $order */ - $order = $this->orderPayPalCache->get($query->getOrderPayPalId()->getValue()); + $order = $this->orderPayPalCache->get($query->getOrderPayPalId()->getValue(), function () use ($query) { + return (new PaypalOrder($query->getOrderPayPalId()->getValue()))->getOrder(); + }); if (!empty($order) && ($order['status'] === 'PENDING' || $order['status'] === 'COMPLETED')) { return new GetPayPalOrderForOrderConfirmationQueryResult($order); diff --git a/src/PayPal/PayPalOrderProvider.php b/src/PayPal/PayPalOrderProvider.php index 0aa857695..8a43af5a9 100644 --- a/src/PayPal/PayPalOrderProvider.php +++ b/src/PayPal/PayPalOrderProvider.php @@ -21,17 +21,16 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; +use PrestaShop\PrestaShop\Core\Domain\Order\ValueObject\OrderId; use Symfony\Contracts\Cache\CacheInterface; class PayPalOrderProvider { - /** - * @var CacheInterface - */ - private $orderPayPalCache; + private CacheInterface $orderPayPalCache; /** * @param CacheInterface $orderPayPalCache + * @param OrderId $orderId */ public function __construct(CacheInterface $orderPayPalCache) { @@ -49,9 +48,17 @@ public function getById($id) return false; } - if ($this->orderPayPalCache->hasItem($id)) { - return $this->orderPayPalCache->get($id); - } + return $this->orderPayPalCache->get($id, function () use ($id) { + $orderPayPal = new PaypalOrder($id); + if (!$orderPayPal->isLoaded()) { + return false; + } + return $orderPayPal->getOrder(); + }); + +// if ($this->orderPayPalCache->hasItem($id)) { +// return $this->orderPayPalCache->getItem($id)->get(); +// } $orderPayPal = new PaypalOrder($id); @@ -61,7 +68,7 @@ public function getById($id) $data = $orderPayPal->getOrder(); - $this->orderPayPalCache->set($id, $data); +// $this->orderPayPalCache->set($id, $data); return $data; } diff --git a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php index a5db09fa8..1209e674c 100644 --- a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php +++ b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php @@ -24,6 +24,9 @@ use PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\AddOrderPaymentCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\CreateOrderCommandHandler; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQuery; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentCompletedQueryResult; @@ -41,49 +44,40 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCapturePendingEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureReversedEvent; +use PrestaShop\Module\PsAccounts\Vendor\Symfony\Component\Cache\CacheItem; use Ps_checkout; use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalCaptureEventSubscriber implements EventSubscriberInterface { - /** - * @var CheckOrderAmount - */ - private $checkOrderAmount; - - /** - * @var CommandBusInterface - */ - private $commandBus; - - /** - * @var CacheInterface - */ - private $capturePayPalCache; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var OrderStateMapper - */ - private $orderStateMapper; + private CheckOrderAmount $checkOrderAmount; + private CacheInterface $capturePayPalCache; + private CacheInterface $orderPayPalCache; + private OrderStateMapper $orderStateMapper; + private CommandBusInterface $queryBus; + private CreateOrderCommandHandler $createOrderCommandHandler; + private AddOrderPaymentCommandHandler $addOrderPaymentCommandHandler; + private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler; public function __construct( - Ps_checkout $module, CheckOrderAmount $checkOrderAmount, CacheInterface $capturePayPalCache, CacheInterface $orderPayPalCache, - OrderStateMapper $orderStateMapper + OrderStateMapper $orderStateMapper, + CommandBusInterface $queryBus, + CreateOrderCommandHandler $createOrderCommandHandler, + AddOrderPaymentCommandHandler $addOrderPaymentCommandHandler, + UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler ) { $this->checkOrderAmount = $checkOrderAmount; $this->capturePayPalCache = $capturePayPalCache; $this->orderPayPalCache = $orderPayPalCache; $this->orderStateMapper = $orderStateMapper; - $this->commandBus = $module->getService('ps_checkout.bus.command'); + $this->queryBus = $queryBus; + $this->createOrderCommandHandler = $createOrderCommandHandler; + $this->addOrderPaymentCommandHandler = $addOrderPaymentCommandHandler; + $this->updateOrderStatusCommandHandler = $updateOrderStatusCommandHandler; } /** @@ -116,7 +110,7 @@ public static function getSubscribedEvents() public function createOrder(PayPalCaptureEvent $event) { - $this->commandBus->handle(new CreateOrderCommand( + $this->createOrderCommandHandler->handle(new CreateOrderCommand( $event->getPayPalOrderId()->getValue(), $event->getCapture() )); @@ -126,7 +120,7 @@ public function createOrderPayment(PayPalCaptureCompletedEvent $event) { try { /** @var GetOrderForPaymentCompletedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -137,7 +131,7 @@ public function createOrderPayment(PayPalCaptureCompletedEvent $event) $capture = $event->getCapture(); - $this->commandBus->handle(new AddOrderPaymentCommand( + $this->addOrderPaymentCommandHandler->handle(new AddOrderPaymentCommand( $order->getOrderId()->getValue(), $capture['create_time'], $order->getPaymentMethod(), @@ -151,7 +145,7 @@ public function setPaymentCompletedOrderStatus(PayPalCaptureCompletedEvent $even { try { /** @var GetOrderForPaymentCompletedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentCompletedQuery($event->getPayPalOrderId()->getValue(), $event->getPayPalCaptureId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -163,10 +157,10 @@ public function setPaymentCompletedOrderStatus(PayPalCaptureCompletedEvent $even switch ($this->checkOrderAmount->checkAmount((string) $order->getTotalAmount(), (string) $event->getCapture()['amount']['value'])) { case CheckOrderAmount::ORDER_FULL_PAID: case CheckOrderAmount::ORDER_TO_MUCH_PAID: - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_COMPLETED))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_COMPLETED))); break; case CheckOrderAmount::ORDER_NOT_FULL_PAID: - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PARTIALLY_PAID))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PARTIALLY_PAID))); break; } } @@ -175,7 +169,7 @@ public function setPaymentPendingOrderStatus(PayPalCapturePendingEvent $event) { try { /** @var GetOrderForPaymentPendingQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentPendingQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentPendingQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -184,14 +178,14 @@ public function setPaymentPendingOrderStatus(PayPalCapturePendingEvent $event) return; } - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PENDING))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_PENDING))); } public function setPaymentDeclinedOrderStatus(PayPalCaptureDeclinedEvent $event) { try { /** @var GetOrderForPaymentDeniedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentDeniedQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentDeniedQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -200,14 +194,14 @@ public function setPaymentDeclinedOrderStatus(PayPalCaptureDeclinedEvent $event) return; } - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_ERROR))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_ERROR))); } public function setPaymentReversedOrderStatus(PayPalCaptureReversedEvent $event) { try { /** @var GetOrderForPaymentReversedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentReversedQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentReversedQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -216,22 +210,28 @@ public function setPaymentReversedOrderStatus(PayPalCaptureReversedEvent $event) return; } - $this->commandBus->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_REFUNDED))); + $this->updateOrderStatusCommandHandler->handle(new UpdateOrderStatusCommand($order->getOrderId()->getValue(), $this->orderStateMapper->getIdByKey(OrderStateConfigurationKeys::PS_CHECKOUT_STATE_REFUNDED))); } public function updateCache(PayPalCaptureEvent $event) { - $this->capturePayPalCache->set($event->getPayPalCaptureId()->getValue(), $event->getCapture()); +// $this->capturePayPalCache->set($event->getPayPalCaptureId()->getValue(), $event->getCapture()); + $this->capturePayPalCache->get($event->getPayPalCaptureId()->getValue(), function () use ($event) { + return $event->getCapture(); + }); $needToClearOrderPayPalCache = true; - $orderPayPalCache = $this->orderPayPalCache->get($event->getPayPalOrderId()->getValue()); + $orderPayPalCache = $this->orderPayPalCache->getItem($event->getPayPalOrderId()->getValue())->get(); if ($orderPayPalCache && isset($orderPayPalCache['purchase_units'][0]['payments']['captures'])) { foreach ($orderPayPalCache['purchase_units'][0]['payments']['captures'] as $key => $capture) { if ($capture['id'] === $event->getPayPalCaptureId()->getValue()) { $needToClearOrderPayPalCache = false; $orderPayPalCache['purchase_units'][0]['payments']['captures'][$key] = $event->getCapture(); - $this->orderPayPalCache->set($event->getPayPalOrderId()->getValue(), $orderPayPalCache); +// $this->orderPayPalCache->set($event->getPayPalOrderId()->getValue(), $orderPayPalCache); + $this->orderPayPalCache->get($event->getPayPalOrderId()->getValue(), function () use ($orderPayPalCache) { + return $orderPayPalCache; + }); } } } diff --git a/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php b/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php index 3f6ef1edf..42b7a2467 100644 --- a/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php +++ b/src/PayPal/Payment/Refund/CommandHandler/RefundPayPalCaptureCommandHandler.php @@ -28,6 +28,7 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Command\RefundPayPalCaptureCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalCaptureRefundedEvent; +use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber\PayPalRefundEventSubscriber; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Exception\PayPalRefundFailedException; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; @@ -53,19 +54,26 @@ class RefundPayPalCaptureCommandHandler * @var EventDispatcherInterface */ private $eventDispatcher; + private PayPalRefundEventSubscriber $payPalRefundEventSubscriber; public function __construct( MaaslandHttpClient $checkoutHttpClient, PayPalConfiguration $payPalConfiguration, PrestaShopConfiguration $prestaShopConfiguration, PrestaShopContext $prestaShopContext, - EventDispatcherInterface $eventDispatcher + PayPalRefundEventSubscriber $payPalRefundEventSubscriber ) { $this->checkoutHttpClient = $checkoutHttpClient; $this->payPalConfiguration = $payPalConfiguration; $this->prestaShopConfiguration = $prestaShopConfiguration; $this->prestaShopContext = $prestaShopContext; - $this->eventDispatcher = $eventDispatcher; + $this->payPalRefundEventSubscriber = $payPalRefundEventSubscriber; + } + + + public function __invoke(RefundPayPalCaptureCommand $command) + { + $this->handle($command); } /** @@ -75,7 +83,7 @@ public function __construct( * @throws PayPalRefundFailedException * @throws PayPalOrderException */ - public function __invoke(RefundPayPalCaptureCommand $command) + public function handle(RefundPayPalCaptureCommand $command) { $response = $this->checkoutHttpClient->refundOrder([ 'orderId' => $command->getOrderPayPalId(), @@ -95,12 +103,14 @@ public function __invoke(RefundPayPalCaptureCommand $command) ]); $refund = json_decode($response->getBody(), true); - $this->eventDispatcher->dispatch( - new PayPalCaptureRefundedEvent( - $refund['id'], - $command->getOrderPayPalId(), - $refund - ) + + $event = new PayPalCaptureRefundedEvent( + $refund['id'], + $command->getOrderPayPalId(), + $refund ); + + $this->payPalRefundEventSubscriber->setPaymentRefundedOrderStatus($event); + $this->payPalRefundEventSubscriber->updateCache($event); } } diff --git a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php index 2ffd9985e..ead5a6512 100644 --- a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php +++ b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php @@ -22,6 +22,7 @@ use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; +use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQuery; use PrestaShop\Module\PrestashopCheckout\Order\Query\GetOrderForPaymentRefundedQueryResult; @@ -30,47 +31,29 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalCaptureRefundedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\Event\PayPalRefundEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; -use Ps_checkout; use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class PayPalRefundEventSubscriber implements EventSubscriberInterface { - /** - * @var Ps_checkout - */ - private $module; - - /** - * @var CommandBusInterface - */ - private $commandBus; - - /** - * @var CacheInterface - */ - private $orderPayPalCache; - - /** - * @var OrderStateMapper - */ - private $orderStateMapper; - /** - * @var PayPalOrderProvider - */ - private $orderProvider; + private CacheInterface $orderPayPalCache; + private OrderStateMapper $orderStateMapper; + private PayPalOrderProvider $orderProvider; + private CommandBusInterface $queryBus; + private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler; public function __construct( - Ps_checkout $module, CacheInterface $orderPayPalCache, OrderStateMapper $orderStateMapper, - PayPalOrderProvider $orderProvider + PayPalOrderProvider $orderProvider, + CommandBusInterface $queryBus, + UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler ) { - $this->module = $module; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); $this->orderPayPalCache = $orderPayPalCache; $this->orderStateMapper = $orderStateMapper; $this->orderProvider = $orderProvider; + $this->queryBus = $queryBus; + $this->updateOrderStatusCommandHandler = $updateOrderStatusCommandHandler; } /** @@ -90,7 +73,7 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) { try { /** @var GetOrderForPaymentRefundedQueryResult $order */ - $order = $this->commandBus->handle(new GetOrderForPaymentRefundedQuery($event->getPayPalOrderId()->getValue())); + $order = $this->queryBus->handle(new GetOrderForPaymentRefundedQuery($event->getPayPalOrderId()->getValue())); } catch (OrderNotFoundException $exception) { return; } @@ -126,7 +109,7 @@ public function setPaymentRefundedOrderStatus(PayPalCaptureRefundedEvent $event) return; } - $this->commandBus->handle( + $this->updateOrderStatusCommandHandler->handle( new UpdateOrderStatusCommand( $order->getOrderId()->getValue(), $newOrderState diff --git a/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php b/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php index 6c165e039..a74e2dc22 100644 --- a/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php +++ b/src/PayPal/PaymentToken/EventSubscriber/PaymentMethodTokenEventSubscriber.php @@ -20,15 +20,14 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\EventSubscriber; +use Exception; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; -use PrestaShop\Module\PrestashopCheckout\PayPal\Customer\ValueObject\PayPalCustomerId; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\ValueObject\PayPalOrderId; -use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\SavePaymentTokenCommand; +use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Entity\PaymentToken; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Event\PaymentTokenCreatedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Event\PaymentTokenDeletedEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Event\PaymentTokenDeletionInitiatedEvent; -use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\ValueObject\PaymentTokenId; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; use PrestaShop\Module\PrestashopCheckout\Repository\PayPalOrderRepository; use Ps_checkout; @@ -36,24 +35,12 @@ class PaymentMethodTokenEventSubscriber implements EventSubscriberInterface { - /** @var Ps_checkout */ - private $module; + private PayPalOrderRepository $payPalOrderRepository; - /** @var CommandBusInterface */ - private $commandBus; - /** - * @var PayPalOrderRepository - */ - private $payPalOrderRepository; - /** - * @var PaymentTokenRepository - */ - private $paymentTokenRepository; + private PaymentTokenRepository $paymentTokenRepository; - public function __construct(Ps_checkout $module, PayPalOrderRepository $payPalOrderRepository, PaymentTokenRepository $paymentTokenRepository) + public function __construct(PayPalOrderRepository $payPalOrderRepository, PaymentTokenRepository $paymentTokenRepository) { - $this->module = $module; - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); $this->payPalOrderRepository = $payPalOrderRepository; $this->paymentTokenRepository = $paymentTokenRepository; } @@ -86,19 +73,24 @@ public function saveCreatedPaymentMethodToken(PaymentTokenCreatedEvent $event) try { $order = $this->payPalOrderRepository->getPayPalOrderById(new PayPalOrderId($orderId)); $setFavorite = $order->checkCustomerIntent(PayPalOrder::CUSTOMER_INTENT_FAVORITE); - } catch (\Exception $exception) { + } catch (Exception $exception) { } } - $this->commandBus->handle(new SavePaymentTokenCommand( - new PaymentTokenId($resource['id']), - new PayPalCustomerId($resource['customer']['id']), - $resource['payment_source'][array_keys($resource['payment_source'])[0]]['verification_status'], + $token = new PaymentToken( + $resource['id'], + $resource['customer']['id'], array_keys($resource['payment_source'])[0], $resource, $event->getMerchantId(), + $resource['payment_source'][array_keys($resource['payment_source'])[0]]['verification_status'], $setFavorite - )); + ); + $this->paymentTokenRepository->save($token); + + if ($setFavorite) { + $this->paymentTokenRepository->setTokenFavorite($resource['id']); + } } public function deletePaymentMethodToken(PaymentTokenDeletedEvent $event) diff --git a/src/Repository/PsCheckoutCartRepository.php b/src/Repository/PsCheckoutCartRepository.php index 3a10e5cfd..35a69d77e 100644 --- a/src/Repository/PsCheckoutCartRepository.php +++ b/src/Repository/PsCheckoutCartRepository.php @@ -26,6 +26,7 @@ use PrestaShopDatabaseException; use PrestaShopException; use PsCheckoutCart; +use Symfony\Component\Cache\CacheItem; use Symfony\Contracts\Cache\CacheInterface; class PsCheckoutCartRepository @@ -52,9 +53,20 @@ public function __construct(CacheInterface $cartPrestaShopCache) */ public function findOneByCartId($cartId) { - if ($this->cartPrestaShopCache->hasItem(CacheSettings::CART_ID . $cartId)) { - return $this->cartPrestaShopCache->get(CacheSettings::CART_ID . $cartId); - } + return $this->cartPrestaShopCache->get(CacheSettings::CART_ID . $cartId, function (CacheItem $item) use ($cartId) { + $item->expiresAfter(3600); + $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); + $psCheckoutCartCollection->where('id_cart', '=', (int) $cartId); + $psCheckoutCartCollection->orderBy('date_upd', 'desc'); + + /** @var PsCheckoutCart|false $psCheckoutCart */ + $psCheckoutCart = $psCheckoutCartCollection->getFirst(); + return $psCheckoutCart; + }); + +// if ($this->cartPrestaShopCache->hasItem(CacheSettings::CART_ID . $cartId)) { +// return $this->cartPrestaShopCache->get(CacheSettings::CART_ID . $cartId); +// } $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); $psCheckoutCartCollection->where('id_cart', '=', (int) $cartId); @@ -64,10 +76,10 @@ public function findOneByCartId($cartId) $psCheckoutCart = $psCheckoutCartCollection->getFirst(); if (false !== $psCheckoutCart) { - $this->cartPrestaShopCache->setMultiple([ - CacheSettings::CART_ID . $cartId => $psCheckoutCart, - CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order => $psCheckoutCart, - ]); +// $this->cartPrestaShopCache->setMultiple([ +// CacheSettings::CART_ID . $cartId => $psCheckoutCart, +// CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order => $psCheckoutCart, +// ]); } return $psCheckoutCart; @@ -82,8 +94,18 @@ public function findOneByCartId($cartId) */ public function findOneByPayPalOrderId($payPalOrderId) { + return $this->cartPrestaShopCache->get(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId, function (CacheItem $item) use ($payPalOrderId) { + $item->expiresAfter(3600); + $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); + $psCheckoutCartCollection->where('paypal_order', '=', $payPalOrderId); + + /** @var PsCheckoutCart|false $psCheckoutCart */ + $psCheckoutCart = $psCheckoutCartCollection->getFirst(); + return $psCheckoutCart; + }); + if ($this->cartPrestaShopCache->hasItem(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId)) { - return $this->cartPrestaShopCache->get(CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId); + } $psCheckoutCartCollection = new PrestaShopCollection('PsCheckoutCart'); @@ -93,10 +115,10 @@ public function findOneByPayPalOrderId($payPalOrderId) $psCheckoutCart = $psCheckoutCartCollection->getFirst(); if (false !== $psCheckoutCart) { - $this->cartPrestaShopCache->setMultiple([ - CacheSettings::CART_ID . $psCheckoutCart->id_cart => $psCheckoutCart, - CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId => $psCheckoutCart, - ]); +// $this->cartPrestaShopCache->setMultiple([ +// CacheSettings::CART_ID . $psCheckoutCart->id_cart => $psCheckoutCart, +// CacheSettings::PAYPAL_ORDER_ID . $payPalOrderId => $psCheckoutCart, +// ]); } return $psCheckoutCart; @@ -118,10 +140,17 @@ public function save(PsCheckoutCart $psCheckoutCart) $success = $psCheckoutCart->save(); if ($success) { - $this->cartPrestaShopCache->setMultiple([ - CacheSettings::CART_ID . $psCheckoutCart->id_cart => $psCheckoutCart, - CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order => $psCheckoutCart, - ]); + $cacheItem = $this->cartPrestaShopCache->getItem(CacheSettings::CART_ID . $psCheckoutCart->id_cart); + $cacheItem->set($psCheckoutCart); + $this->cartPrestaShopCache->save($cacheItem); + $cacheItem = $this->cartPrestaShopCache->getItem(CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order); + $cacheItem->set($psCheckoutCart); + $this->cartPrestaShopCache->save($cacheItem); + +// $this->cartPrestaShopCache->setMultiple([ +// CacheSettings::CART_ID . $psCheckoutCart->id_cart => $psCheckoutCart, +// CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order => $psCheckoutCart, +// ]); } return $success; @@ -143,10 +172,8 @@ public function remove(PsCheckoutCart $psCheckoutCart) $success = $psCheckoutCart->delete(); if ($success) { - $this->cartPrestaShopCache->deleteMultiple([ - CacheSettings::CART_ID . $psCheckoutCart->id_cart, - CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order, - ]); + $this->cartPrestaShopCache->delete(CacheSettings::CART_ID . $psCheckoutCart->id_cart); + $this->cartPrestaShopCache->delete(CacheSettings::PAYPAL_ORDER_ID . $psCheckoutCart->paypal_order); } return $success; diff --git a/src/Webhook/WebhookEventConfigurationUpdatedHandler.php b/src/Webhook/WebhookEventConfigurationUpdatedHandler.php index 72719f45e..a01b56ec5 100644 --- a/src/Webhook/WebhookEventConfigurationUpdatedHandler.php +++ b/src/Webhook/WebhookEventConfigurationUpdatedHandler.php @@ -56,7 +56,7 @@ public function supports(array $payload) * @throws WebhookException * @throws PsCheckoutException */ - public function __invoke(array $payload) + public function handle(array $payload) { $this->assertPayloadIsValid($payload); From 01ba9b3b29b7217e540cb825ddfe88261f8fdb9a Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Mon, 30 Dec 2024 16:52:39 +0200 Subject: [PATCH 05/38] Fixed some command handlers --- config/common.yml | 5 ----- .../CommandHandler/CancelCheckoutCommandHandler.php | 6 +++++- src/Handler/CreatePaypalOrderHandler.php | 2 +- .../CommandHandler/SavePayPalCustomerCommandHandler.php | 5 +++++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/config/common.yml b/config/common.yml index 86f43e963..3434011b5 100644 --- a/config/common.yml +++ b/config/common.yml @@ -47,11 +47,6 @@ services: public: true factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] - ps_checkout.bus.command2: - class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusAdapter' - public: true - factory: [ '@PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianCommandBusFactory', "create" ] - ps_checkout.bus.query: class: 'PrestaShop\Module\PrestashopCheckout\CommandBus\TacticianQueryBusAdapter' public: true diff --git a/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php b/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php index 3b29c6040..bb7e7d593 100644 --- a/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php +++ b/src/Checkout/CommandHandler/CancelCheckoutCommandHandler.php @@ -39,12 +39,16 @@ public function __construct(PsCheckoutCartRepository $psCheckoutCartRepository) $this->psCheckoutCartRepository = $psCheckoutCartRepository; } + public function __invoke(CancelCheckoutCommand $command) { + $this->handle($command); + } + /** * @param CancelCheckoutCommand $command * * @throws PsCheckoutSessionException */ - public function __invoke(CancelCheckoutCommand $command) + public function handle(CancelCheckoutCommand $command) { try { /** @var PsCheckoutCart|false $psCheckoutCart */ diff --git a/src/Handler/CreatePaypalOrderHandler.php b/src/Handler/CreatePaypalOrderHandler.php index 13471047b..beb2d808f 100644 --- a/src/Handler/CreatePaypalOrderHandler.php +++ b/src/Handler/CreatePaypalOrderHandler.php @@ -55,7 +55,7 @@ public function __construct(Context $context) * * @throws PsCheckoutException */ - public function __invoke($expressCheckout = false, $isCardPayment = false, $updateOrder = false, $paypalOrderId = null) + public function handle($expressCheckout = false, $isCardPayment = false, $updateOrder = false, $paypalOrderId = null) { // Present an improved cart in order to create the payload $cartPresenter = (new CartPresenter())->present(); diff --git a/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php b/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php index ded20a410..5826d8bbb 100644 --- a/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php +++ b/src/PayPal/Customer/CommandHandler/SavePayPalCustomerCommandHandler.php @@ -36,6 +36,11 @@ public function __construct(PayPalCustomerRepository $payPalCustomerRepository) } public function __invoke(SavePayPalCustomerCommand $command) + { + $this->handle($command); + } + + public function handle(SavePayPalCustomerCommand $command) { try { $this->payPalCustomerRepository->findPayPalCustomerIdByCustomerId($command->getCustomerId()); From 14a73831202de4db382b8252cb6b2a9463b3c11f Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Tue, 31 Dec 2024 14:52:58 +0200 Subject: [PATCH 06/38] Fixed translation in admin ajax controller --- .../AdminAjaxPrestashopCheckoutController.php | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/controllers/admin/AdminAjaxPrestashopCheckoutController.php b/controllers/admin/AdminAjaxPrestashopCheckoutController.php index 7c4444ad8..9022f985f 100755 --- a/controllers/admin/AdminAjaxPrestashopCheckoutController.php +++ b/controllers/admin/AdminAjaxPrestashopCheckoutController.php @@ -354,13 +354,12 @@ public function ajaxProcessFetchOrder() { $isLegacy = (bool) Tools::getValue('legacy'); $id_order = (int) Tools::getValue('id_order'); - if (empty($id_order)) { http_response_code(400); $this->exitWithResponse([ 'status' => false, 'errors' => [ - $this->l('No PrestaShop Order identifier received'), + $this->trans('No PrestaShop Order identifier received', [], 'Modules.Pscheckout.Admin'), ], ]); } @@ -373,7 +372,7 @@ public function ajaxProcessFetchOrder() 'status' => false, 'errors' => [ strtr( - $this->l('This PrestaShop Order [PRESTASHOP_ORDER_ID] is not paid with PrestaShop Checkout'), + $this->trans('This PrestaShop Order [PRESTASHOP_ORDER_ID] is not paid with PrestaShop Checkout', [], 'Modules.Pscheckout.Admin'), [ '[PRESTASHOP_ORDER_ID]' => $order->id, ] @@ -392,7 +391,7 @@ public function ajaxProcessFetchOrder() 'status' => false, 'errors' => [ strtr( - $this->l('Unable to find PayPal Order associated to this PrestaShop Order [PRESTASHOP_ORDER_ID]'), + $this->trans('Unable to find PayPal Order associated to this PrestaShop Order [PRESTASHOP_ORDER_ID]', [], 'Modules.Pscheckout.Admin'), [ '[PRESTASHOP_ORDER_ID]' => $order->id, ] @@ -419,7 +418,7 @@ public function ajaxProcessFetchOrder() 'status' => false, 'errors' => [ strtr( - $this->l('PayPal Order [PAYPAL_ORDER_ID] is not in the same environment as PrestaShop Checkout'), + $this->trans('PayPal Order [PAYPAL_ORDER_ID] is not in the same environment as PrestaShop Checkout', [], 'Modules.Pscheckout.Admin'), [ '[PAYPAL_ORDER_ID]' => $psCheckoutCart->paypal_order, ] @@ -485,23 +484,23 @@ public function ajaxProcessRefundOrder() 'httpCode' => $exception->getCode(), 'status' => false, 'errors' => [ - $this->l('Refund cannot be processed by PayPal.', 'translations'), + $this->trans('Refund cannot be processed by PayPal.', [], 'Modules.Pscheckout.Admin'), ], ]); } catch (PayPalRefundException $invalidArgumentException) { $error = ''; switch ($invalidArgumentException->getCode()) { case PayPalRefundException::INVALID_ORDER_ID: - $error = $this->l('PayPal Order is invalid.', 'translations'); + $error = $this->trans('PayPal Order is invalid.', [], 'Modules.Pscheckout.Admin'); break; case PayPalRefundException::INVALID_TRANSACTION_ID: - $error = $this->l('PayPal Transaction is invalid.', 'translations'); + $error = $this->trans('PayPal Transaction is invalid.', [], 'Modules.Pscheckout.Admin'); break; case PayPalRefundException::INVALID_CURRENCY: - $error = $this->l('PayPal refund currency is invalid.', 'translations'); + $error = $this->trans('PayPal refund currency is invalid.', [], 'Modules.Pscheckout.Admin'); break; case PayPalRefundException::INVALID_AMOUNT: - $error = $this->l('PayPal refund amount is invalid.', 'translations'); + $error = $this->trans('PayPal refund amount is invalid.', [], 'Modules.Pscheckout.Admin'); break; default: break; @@ -516,7 +515,7 @@ public function ajaxProcessRefundOrder() $this->exitWithResponse([ 'httpCode' => 200, 'status' => true, - 'content' => $this->l('Refund has been processed by PayPal, but order status change or email sending failed.', 'translations'), + 'content' => $this->trans('Refund has been processed by PayPal, but order status change or email sending failed.', [], 'Modules.Pscheckout.Admin'), ]); } elseif ($exception->getCode() !== OrderException::ORDER_HAS_ALREADY_THIS_STATUS) { $this->exitWithResponse([ @@ -533,7 +532,7 @@ public function ajaxProcessRefundOrder() 'httpCode' => 500, 'status' => false, 'errors' => [ - $this->l('Refund cannot be processed by PayPal.', 'translations'), + $this->trans('Refund cannot be processed by PayPal.', [], 'Modules.Pscheckout.Admin'), ], 'error' => $exception->getMessage(), ]); @@ -542,7 +541,7 @@ public function ajaxProcessRefundOrder() $this->exitWithResponse([ 'httpCode' => 200, 'status' => true, - 'content' => $this->l('Refund has been processed by PayPal.', 'translations'), + 'content' => $this->trans('Refund has been processed by PayPal.', [], 'Modules.Pscheckout.Admin'), ]); } From 4e2610621b739dae5608d690ae546bed4a9ddeb6 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Thu, 2 Jan 2025 13:55:23 +0200 Subject: [PATCH 07/38] Removed commented code --- src/Order/EventSubscriber/OrderEventSubscriber.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Order/EventSubscriber/OrderEventSubscriber.php b/src/Order/EventSubscriber/OrderEventSubscriber.php index a757b0ae0..7eb280bf3 100644 --- a/src/Order/EventSubscriber/OrderEventSubscriber.php +++ b/src/Order/EventSubscriber/OrderEventSubscriber.php @@ -70,10 +70,5 @@ public function updateOrderMatrice(OrderCreatedEvent $event) $orderMatrice->id_order_paypal = $psCheckoutCart->getPaypalOrderId(); $orderMatrice->add(); - -// $this->commandBus->handle(new UpdateOrderMatriceCommand( -// $event->getOrderId()->getValue(), -// $psCheckoutCart->getPaypalOrderId() -// )); } } From 67e5f162a49ab799b3722f8a252eb0e5a1a4c05c Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Thu, 2 Jan 2025 17:42:01 +0200 Subject: [PATCH 08/38] Added latest features from PS8 --- config/cache.yml | 2 +- config/common.yml | 10 +-- controllers/front/applepay.php | 4 +- controllers/front/create.php | 3 +- controllers/front/googlepay.php | 4 +- controllers/front/payment.php | 85 +++++++++++++------ controllers/front/validate.php | 7 +- controllers/front/vault.php | 3 +- src/Checkout/CheckoutChecker.php | 2 +- .../CheckoutEventSubscriber.php | 57 ++++++++----- src/CommandBus/QueryBusInterface.php | 34 ++++++++ src/CommandBus/TacticianQueryBusAdapter.php | 23 ++++- src/CommandBus/TacticianQueryBusFactory.php | 41 ++++++++- .../ToggleShopConfigurationCommandHandler.php | 6 +- src/Exception/PsCheckoutException.php | 2 + .../CreateOrderCommandHandler.php | 1 - .../UpdateOrderStatusCommandHandler.php | 4 - .../UpdateOrderMatriceCommandHandler.php | 6 +- src/PayPal/OAuth/PayPalCustomerIdProvider.php | 29 ------- src/PayPal/Order/Cache/PayPalOrderCache.php | 56 ++++++++++++ src/PayPal/Order/Cache/index.php | 28 ++++++ .../CapturePayPalOrderCommandHandler.php | 4 +- .../CreatePayPalOrderCommandHandler.php | 2 +- .../PayPalOrderEventSubscriber.php | 14 ++- src/PayPal/Order/PaypalOrderDataProvider.php | 15 ++-- .../GetPayPalOrderForCartIdQueryHandler.php | 6 +- ...lOrderForCheckoutCompletedQueryHandler.php | 14 ++- src/PayPal/PayPalOrderProvider.php | 26 ++---- .../PayPalCaptureEventSubscriber.php | 8 +- .../PayPalRefundEventSubscriber.php | 6 +- .../Sdk/PayPalSdkConfigurationBuilder.php | 23 ++--- src/Webhook/WebhookHandler.php | 2 +- 32 files changed, 350 insertions(+), 177 deletions(-) create mode 100644 src/CommandBus/QueryBusInterface.php delete mode 100644 src/PayPal/OAuth/PayPalCustomerIdProvider.php create mode 100644 src/PayPal/Order/Cache/PayPalOrderCache.php create mode 100644 src/PayPal/Order/Cache/index.php diff --git a/config/cache.yml b/config/cache.yml index 48a4c4b98..f2f3e9f77 100644 --- a/config/cache.yml +++ b/config/cache.yml @@ -18,7 +18,7 @@ services: - '@=service("PrestaShop\\ModuleLibCacheDirectoryProvider\\Cache\\CacheDirectoryProvider").getPath()' ps_checkout.cache.paypal.order: - class: 'Symfony\Component\Cache\Adapter\ChainAdapter' + class: 'PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache\PayPalOrderCache' public: true arguments: - [ diff --git a/config/common.yml b/config/common.yml index 3434011b5..e97d76e8d 100644 --- a/config/common.yml +++ b/config/common.yml @@ -269,7 +269,7 @@ services: - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' - '@ps_checkout.logger' - '@PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceEligibilityConstraint' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider' + - '@ps_checkout.bus.query' PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule: class: 'PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\PaypalModule' @@ -518,11 +518,3 @@ services: public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Translations\Translations' - - PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider: - class: 'PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\PayPalCustomerIdProvider' - public: true - arguments: - - '@PrestaShop\Module\PrestashopCheckout\PayPal\OAuth\OAuthService' - - '@PrestaShop\Module\PrestashopCheckout\Repository\PayPalCustomerRepository' - - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' diff --git a/controllers/front/applepay.php b/controllers/front/applepay.php index 1c31f965b..0d17d7760 100644 --- a/controllers/front/applepay.php +++ b/controllers/front/applepay.php @@ -21,6 +21,7 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Cart\ValueObject\CartId; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration; @@ -37,7 +38,7 @@ class Ps_CheckoutApplepayModuleFrontController extends AbstractFrontController private CommandBusInterface $commandBus; - private CommandBusInterface $queryBus; + private QueryBusInterface $queryBus; /** * @see FrontController::postProcess() @@ -61,6 +62,7 @@ public function postProcess() } $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $this->module->getService('ps_checkout.bus.query'); switch ($action) { case 'getPaymentRequest': diff --git a/controllers/front/create.php b/controllers/front/create.php index bb701b610..8af4bd233 100755 --- a/controllers/front/create.php +++ b/controllers/front/create.php @@ -21,6 +21,7 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartNotFoundException; use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCartIdQuery; @@ -129,7 +130,7 @@ public function postProcess() /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); - /** @var CommandBusInterface $queryBus */ + /** @var QueryBusInterface $queryBus */ $queryBus = $this->module->getService('ps_checkout.bus.query'); $commandBus->handle(new CreatePayPalOrderCommand($cartId, $fundingSource, $isCardFields, $isExpressCheckout, $vaultId, $favorite, $vault)); diff --git a/controllers/front/googlepay.php b/controllers/front/googlepay.php index c6bda3945..3f2a74f6a 100644 --- a/controllers/front/googlepay.php +++ b/controllers/front/googlepay.php @@ -19,7 +19,7 @@ */ use PrestaShop\Module\PrestashopCheckout\Cart\ValueObject\CartId; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\GooglePay\Query\GetGooglePayTransactionInfoQuery; @@ -33,7 +33,7 @@ class Ps_CheckoutGooglepayModuleFrontController extends AbstractFrontController */ public $module; - private CommandBusInterface $queryBus; + private QueryBusInterface $queryBus; /** * @see FrontController::postProcess() diff --git a/controllers/front/payment.php b/controllers/front/payment.php index b87e3d889..f047691e3 100644 --- a/controllers/front/payment.php +++ b/controllers/front/payment.php @@ -19,6 +19,7 @@ */ use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; @@ -48,9 +49,12 @@ class Ps_CheckoutPaymentModuleFrontController extends AbstractFrontController */ private $paypalOrderId; + private CommandBusInterface $commandBus; + private QueryBusInterface $queryBus; + public function checkAccess() { - return $this->context->customer && $this->context->customer->isLogged() && $this->context->cart; + return $this->context->customer && $this->context->cart; } public function initContent() @@ -79,33 +83,42 @@ public function postProcess() try { $this->paypalOrderId = new PayPalOrderId($orderId); + $this->commandBus = $this->module->getService('ps_checkout.bus.command'); + $this->queryBus = $this->module->getService('ps_checkout.bus.query'); + /** @var PayPalOrderRepository $payPalOrderRepository */ $payPalOrderRepository = $this->module->getService(PayPalOrderRepository::class); - /** @var PayPalOrderProvider $payPalOrderProvider */ - $payPalOrderProvider = $this->module->getService(PayPalOrderProvider::class); - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->module->getService('ps_checkout.bus.command'); /** @var Symfony\Contracts\Cache\CacheInterface $payPalOrderCache */ $payPalOrderCache = $this->module->getService('ps_checkout.cache.paypal.order'); $payPalOrder = $payPalOrderRepository->getPayPalOrderById($this->paypalOrderId); + $orders = new PrestaShopCollection(Order::class); + $orders->where('id_cart', '=', $payPalOrder->getIdCart()); + + if ($orders->count()) { + if ($this->context->customer->isLogged()) { + $this->redirectToOrderHistoryPage(); + } else { + $payPalOrderQueryResult = $this->getPayPalOrder($orderId); + $payPalOrderFromCache = $payPalOrderQueryResult->getPayPalOrder(); + + $this->redirectToOrderConfirmationPage($payPalOrder->getIdCart(), $payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0]['id'], $payPalOrderFromCache['status']); + } + } + if ($payPalOrder->getIdCart() !== $this->context->cart->id) { - throw new Exception('PayPal order does not belong to this customer'); + $this->redirectToOrderPage(); } - $payPalOrderFromCache = $payPalOrderProvider->getById($payPalOrder->getId()->getValue()); + $payPalOrderQueryResult = $this->getPayPalOrder($orderId); + $payPalOrderFromCache = $payPalOrderQueryResult->getPayPalOrder(); if ($payPalOrderFromCache['status'] === 'COMPLETED') { $this->createOrder($payPalOrderFromCache, $payPalOrder); } if ($payPalOrderFromCache['status'] === 'PAYER_ACTION_REQUIRED') { - // Delete from cache so when user is redirected from 3DS authentication page the order is fetched from PayPal - if ($payPalOrderCache->hasItem($this->paypalOrderId->getValue())) { - $payPalOrderCache->delete($this->paypalOrderId->getValue()); - } - $this->redirectTo3DSVerification($payPalOrderFromCache); } @@ -117,8 +130,8 @@ public function postProcess() $this->redirectTo3DSVerification($payPalOrderFromCache); break; case Card3DSecure::PROCEED: - $commandBus->handle(new CapturePayPalOrderCommand($this->paypalOrderId->getValue(), array_keys($payPalOrderFromCache['payment_source'])[0])); - $payPalOrderFromCache = $payPalOrderCache->get($this->paypalOrderId->getValue()); + $this->commandBus->handle(new CapturePayPalOrderCommand($orderId, array_keys($payPalOrderFromCache['payment_source'])[0])); + $payPalOrderFromCache = $payPalOrderCache->get($orderId); $this->createOrder($payPalOrderFromCache, $payPalOrder); break; case Card3DSecure::NO_DECISION: @@ -126,6 +139,12 @@ public function postProcess() break; } } + + if ($payPalOrderFromCache['status'] === 'APPROVED') { + $this->commandBus->handle(new CapturePayPalOrderCommand($orderId, array_keys($payPalOrderFromCache['payment_source'])[0])); + $payPalOrderFromCache = $payPalOrderCache->get($orderId); + $this->createOrder($payPalOrderFromCache, $payPalOrder); + } } catch (Exception $exception) { $this->context->smarty->assign('error', $exception->getMessage()); } @@ -143,19 +162,14 @@ public function postProcess() */ private function createOrder($payPalOrderFromCache, $payPalOrder) { - /** @var CommandBusInterface $commandBus */ - $commandBus = $this->module->getService('ps_checkout.bus.command'); - - $capture = $payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0]; - if ($capture['status'] === 'COMPLETED') { - $commandBus->handle(new CreateOrderCommand($payPalOrder->getId()->getValue(), $capture)); - if ($payPalOrder->getPaymentTokenId() && $payPalOrder->checkCustomerIntent(PayPalOrder::CUSTOMER_INTENT_FAVORITE)) { - /** @var PaymentTokenRepository $paymentTokenRepository */ - $paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class); - $paymentTokenRepository->setTokenFavorite($payPalOrder->getPaymentTokenId()); - } - $this->redirectToOrderConfirmationPage($payPalOrder->getIdCart(), $capture['id'], $payPalOrderFromCache['status']); + $capture = isset($payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0]) ? $payPalOrderFromCache['purchase_units'][0]['payments']['captures'][0] : null; + $this->commandBus->handle(new CreateOrderCommand($payPalOrder->getId()->getValue(), $capture)); + if ($payPalOrder->getPaymentTokenId() && $payPalOrder->checkCustomerIntent(PayPalOrder::CUSTOMER_INTENT_FAVORITE)) { + /** @var PaymentTokenRepository $paymentTokenRepository */ + $paymentTokenRepository = $this->module->getService(PaymentTokenRepository::class); + $paymentTokenRepository->setTokenFavorite($payPalOrder->getPaymentTokenId()); } + $this->redirectToOrderConfirmationPage($payPalOrder->getIdCart(), $capture ? $capture['id'] : null, $payPalOrderFromCache['status']); } /** @@ -218,4 +232,23 @@ private function redirectToOrderConfirmationPage($cartId, $captureId, $payPalOrd )); } } + + /** + * @param string $orderId + * + * @return GetPayPalOrderForCheckoutCompletedQueryResult + * + * @throws PayPalOrderException + */ + private function getPayPalOrder($orderId) + { + $payPalOrderQuery = new GetPayPalOrderForCheckoutCompletedQuery($orderId); + + return $this->queryBus->handle($payPalOrderQuery); + } + + private function redirectToOrderHistoryPage() + { + Tools::redirect($this->context->link->getPageLink('history')); + } } diff --git a/controllers/front/validate.php b/controllers/front/validate.php index c4c18a00e..78c57df43 100644 --- a/controllers/front/validate.php +++ b/controllers/front/validate.php @@ -20,7 +20,7 @@ */ use PrestaShop\Module\PrestashopCheckout\Checkout\Event\CheckoutCompletedEvent; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Event\SymfonyEventDispatcherAdapter; @@ -126,7 +126,7 @@ private function generateResponse() } try { - /** @var CommandBusInterface $queryBus */ + /** @var QueryBusInterface $queryBus */ $queryBus = $this->module->getService('ps_checkout.bus.query'); /** @var PsCheckoutCartRepository $psCheckoutCartRepository */ @@ -438,6 +438,9 @@ private function handleException(Exception $exception) 'body' => [ 'error' => [ 'message' => $exceptionMessageForCustomer, + 'code' => (int) $exception->getCode() < 400 && $exception->getPrevious() !== null + ? (int) $exception->getPrevious()->getCode() + : (int) $exception->getCode(), ], ], 'exceptionCode' => $exception->getCode(), diff --git a/controllers/front/vault.php b/controllers/front/vault.php index fa1ebb52f..dac2a4d44 100644 --- a/controllers/front/vault.php +++ b/controllers/front/vault.php @@ -19,6 +19,7 @@ */ use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Command\DeletePaymentTokenCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\PaymentToken\Query\GetCustomerPaymentTokensQuery; @@ -40,7 +41,7 @@ public function postProcess() /** @var CommandBusInterface $commandBus */ $commandBus = $this->module->getService('ps_checkout.bus.command'); - /** @var CommandBusInterface $queryBus */ + /** @var QueryBusInterface $queryBus */ $queryBus = $this->module->getService('ps_checkout.bus.query'); $bodyValues = []; diff --git a/src/Checkout/CheckoutChecker.php b/src/Checkout/CheckoutChecker.php index 60c292ce4..df8bc537c 100644 --- a/src/Checkout/CheckoutChecker.php +++ b/src/Checkout/CheckoutChecker.php @@ -54,7 +54,7 @@ public function __construct(LoggerInterface $logger) public function continueWithAuthorization($cartId, $orderPayPal) { if ($orderPayPal['status'] === 'COMPLETED') { - throw new PsCheckoutException(sprintf('PayPal Order %s is already captured', $orderPayPal['id'])); + throw new PsCheckoutException(sprintf('PayPal Order %s is already captured', $orderPayPal['id']), PsCheckoutException::PAYPAL_ORDER_ALREADY_CAPTURED); } $paymentSource = isset($orderPayPal['payment_source']) ? key($orderPayPal['payment_source']) : ''; diff --git a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php index e7a836da2..affebcfa1 100644 --- a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php +++ b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php @@ -25,7 +25,7 @@ use PrestaShop\Module\PrestashopCheckout\Checkout\Command\UpdatePaymentMethodSelectedCommand; use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler; use PrestaShop\Module\PrestashopCheckout\Checkout\Event\CheckoutCompletedEvent; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Exception\HttpTimeoutException; use PrestaShop\Module\PrestashopCheckout\Exception\PayPalException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; @@ -47,7 +47,7 @@ class CheckoutEventSubscriber implements EventSubscriberInterface { private Ps_checkout $module; - private CommandBusInterface $queryBus; + private QueryBusInterface $queryBus; private CheckoutChecker $checkoutChecker; private PsCheckoutCartRepository $psCheckoutCartRepository; private UpdatePaymentMethodSelectedCommandHandler $updatePaymentMethodSelectedCommandHandler; @@ -58,7 +58,7 @@ public function __construct( CheckoutChecker $checkoutChecker, Ps_checkout $module, PsCheckoutCartRepository $psCheckoutCartRepository, - CommandBusInterface $queryBus, + QueryBusInterface $queryBus, UpdatePaymentMethodSelectedCommandHandler $updatePaymentMethodSelectedCommandHandler, CreateOrderCommandHandler $createOrderCommandHandler, CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler @@ -121,35 +121,46 @@ public function updatePaymentMethodSelected(CheckoutCompletedEvent $event) * @throws PrestaShopDatabaseException * @throws PrestaShopException * @throws PsCheckoutException + * @throws HttpTimeoutException */ public function proceedToPayment(CheckoutCompletedEvent $event) { + $payPalOrderId = $event->getPayPalOrderId()->getValue(); + + /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ + $getPayPalOrderForCheckoutCompletedQueryResult = $this->queryBus->handle(new GetPayPalOrderForCheckoutCompletedQuery( + $payPalOrderId + )); + + $payPalOrder = $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder(); + try { - /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ - $getPayPalOrderForCheckoutCompletedQueryResult = $this->queryBus->handle(new GetPayPalOrderForCheckoutCompletedQuery( - $event->getPayPalOrderId()->getValue() - )); - } catch (HttpTimeoutException $exception) { - $this->createOrderCommandHandler->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); - return; - } + $this->checkoutChecker->continueWithAuthorization($event->getCartId()->getValue(), $payPalOrder); + } catch (PsCheckoutException $exception) { + if ($exception->getCode() === PsCheckoutException::PAYPAL_ORDER_ALREADY_CAPTURED) { + $capture = isset($payPalOrder['purchase_units'][0]['payments']['captures'][0]) ? $payPalOrder['purchase_units'][0]['payments']['captures'][0] : null; + $this->createOrderCommandHandler->handle(new CreateOrderCommand($payPalOrderId, $capture)); - $this->checkoutChecker->continueWithAuthorization($event->getCartId()->getValue(), $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder()); + return; + } else { + throw $exception; + } + } try { $this->capturePayPalOrderCommandHandler->handle( new CapturePayPalOrderCommand( - $event->getPayPalOrderId()->getValue(), + $payPalOrderId, $event->getFundingSource() ) ); } catch (PayPalException $exception) { if ($exception->getCode() === PayPalException::ORDER_NOT_APPROVED) { - $this->createOrderCommandHandler->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); + $this->createOrderCommandHandler->handle(new CreateOrderCommand($payPalOrderId)); return; } elseif ($exception->getCode() === PayPalException::RESOURCE_NOT_FOUND) { - $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($event->getPayPalOrderId()->getValue()); + $psCheckoutCart = $this->psCheckoutCartRepository->findOneByPayPalOrderId($payPalOrderId); if (Validate::isLoadedObject($psCheckoutCart)) { $psCheckoutCart->paypal_status = PsCheckoutCart::STATUS_CANCELED; @@ -158,14 +169,22 @@ public function proceedToPayment(CheckoutCompletedEvent $event) throw $exception; } elseif ($exception->getCode() === PayPalException::ORDER_ALREADY_CAPTURED) { + if (isset($payPalOrder['purchase_units'][0]['payments']['captures'][0])) { + $capture = $payPalOrder['purchase_units'][0]['payments']['captures'][0]; + } else { + $payPalOrderQuery = new GetPayPalOrderForCheckoutCompletedQuery($payPalOrderId); + + /** @var GetPayPalOrderForCheckoutCompletedQueryResult $getPayPalOrderForCheckoutCompletedQueryResult */ + $getPayPalOrderForCheckoutCompletedQueryResult = $this->queryBus->handle($payPalOrderQuery); + $payPalOrder = $getPayPalOrderForCheckoutCompletedQueryResult->getPayPalOrder(); + $capture = isset($payPalOrder['purchase_units'][0]['payments']['captures'][0]) ? $payPalOrder['purchase_units'][0]['payments']['captures'][0] : null; + } + $this->createOrderCommandHandler->handle(new CreateOrderCommand($payPalOrderId, $capture)); + return; } else { throw $exception; } - } catch (HttpTimeoutException $exception) { - $this->createOrderCommandHandler->handle(new CreateOrderCommand($event->getPayPalOrderId()->getValue())); - - return; } } } diff --git a/src/CommandBus/QueryBusInterface.php b/src/CommandBus/QueryBusInterface.php new file mode 100644 index 000000000..bbf4e046f --- /dev/null +++ b/src/CommandBus/QueryBusInterface.php @@ -0,0 +1,34 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\CommandBus; + +/** + * Interface QueryBusInterface defines contract for Query bus. + */ +interface QueryBusInterface +{ + /** + * Handle query. + * + * @param object $query + */ + public function handle($query); +} diff --git a/src/CommandBus/TacticianQueryBusAdapter.php b/src/CommandBus/TacticianQueryBusAdapter.php index eae008fab..cbcb97fda 100644 --- a/src/CommandBus/TacticianQueryBusAdapter.php +++ b/src/CommandBus/TacticianQueryBusAdapter.php @@ -2,7 +2,28 @@ namespace PrestaShop\Module\PrestashopCheckout\CommandBus; -class TacticianQueryBusAdapter extends TacticianCommandBusAdapter +use PrestaShopBundle\CommandBus\MessengerCommandBus; + +class TacticianQueryBusAdapter implements QueryBusInterface { + /** + * @var MessengerCommandBus + */ + private $bus; + + /** + * @param MessengerCommandBus $bus + */ + public function __construct(MessengerCommandBus $bus) + { + $this->bus = $bus; + } + /** + * {@inheritdoc} + */ + public function handle($query) + { + return $this->bus->handle($query); + } } diff --git a/src/CommandBus/TacticianQueryBusFactory.php b/src/CommandBus/TacticianQueryBusFactory.php index abb1ea42e..34e9a4eba 100644 --- a/src/CommandBus/TacticianQueryBusFactory.php +++ b/src/CommandBus/TacticianQueryBusFactory.php @@ -2,7 +2,46 @@ namespace PrestaShop\Module\PrestashopCheckout\CommandBus; -class TacticianQueryBusFactory extends TacticianCommandBusFactory +use PrestaShopBundle\CommandBus\MessengerCommandBus; +use Psr\Log\LoggerInterface; +use Symfony\Component\Messenger\Handler\HandlersLocator; +use Symfony\Component\Messenger\MessageBus; +use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware; + +class TacticianQueryBusFactory { + /** + * @var array + */ + private $queryToHandlerMap; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @param LoggerInterface $logger + * @param array $queryToHandlerMap + */ + public function __construct(LoggerInterface $logger, array $queryToHandlerMap) + { + $this->logger = $logger; + $this->queryToHandlerMap = $queryToHandlerMap; + } + + public function create(): TacticianQueryBusAdapter + { + $handlerMiddleWare = new HandleMessageMiddleware( + new HandlersLocator($this->queryToHandlerMap), + ); + + $handlerMiddleWare->setLogger($this->logger); + + $messengerBus = new MessengerCommandBus( + new MessageBus([$handlerMiddleWare]) + ); + return new TacticianQueryBusAdapter($messengerBus); + } } diff --git a/src/Configuration/ToggleShopConfigurationCommandHandler.php b/src/Configuration/ToggleShopConfigurationCommandHandler.php index 867366b65..07c11791b 100644 --- a/src/Configuration/ToggleShopConfigurationCommandHandler.php +++ b/src/Configuration/ToggleShopConfigurationCommandHandler.php @@ -34,10 +34,14 @@ public function __construct() $this->db = Db::getInstance(); } + public function __invoke(ToggleShopConfigurationCommand $command) { + $this->handle($command); + } + /** * @param ToggleShopConfigurationCommand $command */ - public function __invoke(ToggleShopConfigurationCommand $command) + public function handle(ToggleShopConfigurationCommand $command) { // Due to static cache in Shop::isFeatureActive(), we have to execute this to retrieve an accurate value $isMultiShopEnabled = (bool) $this->db->getValue('SELECT `value` FROM `' . _DB_PREFIX_ . 'configuration` WHERE `name` = "PS_MULTISHOP_FEATURE_ACTIVE"') diff --git a/src/Exception/PsCheckoutException.php b/src/Exception/PsCheckoutException.php index 627675825..1b5256976 100644 --- a/src/Exception/PsCheckoutException.php +++ b/src/Exception/PsCheckoutException.php @@ -89,4 +89,6 @@ class PsCheckoutException extends \Exception const CART_ADDRESS_DELIVERY_INVALID = 57; const CART_DELIVERY_OPTION_INVALID = 58; const PSCHECKOUT_HTTP_UNAUTHORIZED = 59; + + const PAYPAL_ORDER_ALREADY_CAPTURED = 60; } diff --git a/src/Order/CommandHandler/CreateOrderCommandHandler.php b/src/Order/CommandHandler/CreateOrderCommandHandler.php index 974faf785..828e7cf04 100644 --- a/src/Order/CommandHandler/CreateOrderCommandHandler.php +++ b/src/Order/CommandHandler/CreateOrderCommandHandler.php @@ -26,7 +26,6 @@ use Order; use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Context\ContextStateManager; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\FundingSource\FundingSourceTranslationProvider; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; diff --git a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php index afc1f6166..bee331406 100644 --- a/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php +++ b/src/Order/CommandHandler/UpdateOrderStatusCommandHandler.php @@ -29,10 +29,6 @@ class UpdateOrderStatusCommandHandler extends AbstractOrderCommandHandler { - public function __construct() - { - } - public function __invoke(UpdateOrderStatusCommand $command) { $this->handle($command); } diff --git a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php index a4f886f50..61fa8a89d 100644 --- a/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php +++ b/src/Order/Matrice/CommandHandler/UpdateOrderMatriceCommandHandler.php @@ -20,9 +20,7 @@ namespace PrestaShop\Module\PrestashopCheckout\Order\Matrice\CommandHandler; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Order\Matrice\Command\UpdateOrderMatriceCommand; -use PrestaShop\Module\PrestashopCheckout\Order\Matrice\Event\OrderMatriceUpdatedEvent; class UpdateOrderMatriceCommandHandler { @@ -42,8 +40,8 @@ public function __invoke(UpdateOrderMatriceCommand $command) $res = $orderMatrice->add(); - if (!empty($res)) { +// if (!empty($res)) { // $this->eventDispatcher->dispatch(new OrderMatriceUpdatedEvent()); - } +// } } } diff --git a/src/PayPal/OAuth/PayPalCustomerIdProvider.php b/src/PayPal/OAuth/PayPalCustomerIdProvider.php deleted file mode 100644 index 625fe3aa0..000000000 --- a/src/PayPal/OAuth/PayPalCustomerIdProvider.php +++ /dev/null @@ -1,29 +0,0 @@ -OAuthService = $OAuthService; - $this->customerRepository = $customerRepository; - $this->payPalConfiguration = $payPalConfiguration; - } - - public function getCustomerId(CustomerId $customerId = null) - { - $customerIdPayPal = $customerId ? $this->customerRepository->findPayPalCustomerIdByCustomerId($customerId) : null; - $merchantId = $this->payPalConfiguration->getMerchantId(); - - return $this->OAuthService->getUserIdToken($merchantId, $customerIdPayPal); - } -} diff --git a/src/PayPal/Order/Cache/PayPalOrderCache.php b/src/PayPal/Order/Cache/PayPalOrderCache.php new file mode 100644 index 000000000..4a7fe4967 --- /dev/null +++ b/src/PayPal/Order/Cache/PayPalOrderCache.php @@ -0,0 +1,56 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ + +namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache; + +use PsCheckoutCart; +use Psr\Cache\InvalidArgumentException; +use Symfony\Component\Cache\Adapter\ChainAdapter; + +class PayPalOrderCache extends ChainAdapter +{ + const CACHE_TTL = [ + PsCheckoutCart::STATUS_CREATED => 600, + PsCheckoutCart::STATUS_PAYER_ACTION_REQUIRED => 600, + PsCheckoutCart::STATUS_APPROVED => 600, + PsCheckoutCart::STATUS_VOIDED => 3600, + PsCheckoutCart::STATUS_SAVED => 3600, + PsCheckoutCart::STATUS_CANCELED => 3600, + PsCheckoutCart::STATUS_COMPLETED => 3600, + ]; + + /** + * @param string $key + * @param array $value + * @param int $ttl + * + * @throws InvalidArgumentException + */ + public function set($key, $value, $ttl = null): bool + { + if (!$ttl && isset($value['status']) && isset(self::CACHE_TTL[$value['status']])) { + $ttl = self::CACHE_TTL[$value['status']]; + } + + $cacheItem = $this->getItem($key)->set($value)->expiresAfter($ttl); + return $this->save($cacheItem); + } +} diff --git a/src/PayPal/Order/Cache/index.php b/src/PayPal/Order/Cache/index.php new file mode 100644 index 000000000..296d682e8 --- /dev/null +++ b/src/PayPal/Order/Cache/index.php @@ -0,0 +1,28 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php index 6bdc7270b..deff02a3f 100644 --- a/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CapturePayPalOrderCommandHandler.php @@ -22,7 +22,6 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order\CommandHandler; use Configuration; -use Context; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; @@ -94,8 +93,7 @@ public function __invoke(CapturePayPalOrderCommand $capturePayPalOrderCommand) { public function handle(CapturePayPalOrderCommand $capturePayPalOrderCommand) { - $context = Context::getContext(); - $merchantId = Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT', null, null, $context->shop->id); + $merchantId = Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT', null, null, $this->prestaShopContext->getShopId()); $payload = [ 'mode' => $capturePayPalOrderCommand->getFundingSource(), diff --git a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php index f623f2a01..930d13728 100644 --- a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php @@ -25,7 +25,6 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartNotFoundException; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; -use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface; use PrestaShop\Module\PrestashopCheckout\Exception\InvalidRequestException; use PrestaShop\Module\PrestashopCheckout\Exception\NotAuthorizedException; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; @@ -164,6 +163,7 @@ public function handle(CreatePayPalOrderCommand $command) $customerIntent, $command->getPaymentTokenId() ); + $this->payPalOrderEventSubscriber->saveCreatedPayPalOrder($event); $this->payPalOrderEventSubscriber->updateCache($event); } diff --git a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php index 1dc91b9a2..21919ab9b 100644 --- a/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php +++ b/src/PayPal/Order/EventSubscriber/PayPalOrderEventSubscriber.php @@ -27,7 +27,7 @@ use PrestaShop\Module\PrestashopCheckout\Checkout\Command\SavePayPalOrderStatusCommand; use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SaveCheckoutCommandHandler; use PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\SavePayPalOrderStatusCommandHandler; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; @@ -67,11 +67,11 @@ class PayPalOrderEventSubscriber implements EventSubscriberInterface private SaveCheckoutCommandHandler $saveCheckoutCommandHandler; private SavePayPalOrderStatusCommandHandler $savePayPalOrderStatusCommandHandler; private CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler; - private CommandBusInterface $queryBus; + private QueryBusInterface $queryBus; private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler; public function __construct( - CommandBusInterface $queryBus, + QueryBusInterface $queryBus, PsCheckoutCartRepository $psCheckoutCartRepository, CacheInterface $orderPayPalCache, CheckoutChecker $checkoutChecker, @@ -280,16 +280,14 @@ public function setApprovalReversedOrderStatus(PayPalOrderApprovalReversedEvent public function updateCache(PayPalOrderEvent $event) { - $currentOrderPayPal = $this->orderPayPalCache->getItem($event->getOrderPayPalId()->getValue()); + $currentOrderPayPal = $this->orderPayPalCache->getItem($event->getOrderPayPalId()->getValue())->get(); $newOrderPayPal = $event->getOrderPayPal(); - if ($currentOrderPayPal->get() && !$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($currentOrderPayPal->get()['status'], $newOrderPayPal['status'])) { + if ($currentOrderPayPal && !$this->checkTransitionPayPalOrderStatusService->checkAvailableStatus($currentOrderPayPal['status'], $newOrderPayPal['status'])) { return; } - $currentOrderPayPal->set($newOrderPayPal); - $this->orderPayPalCache->save($currentOrderPayPal); -// $this->orderPayPalCache->set($event->getOrderPayPalId()->getValue(), $newOrderPayPal); + $this->orderPayPalCache->set($event->getOrderPayPalId()->getValue(), $newOrderPayPal); } public function updatePayPalOrder(PayPalOrderEvent $event) diff --git a/src/PayPal/Order/PaypalOrderDataProvider.php b/src/PayPal/Order/PaypalOrderDataProvider.php index ed5c296ef..b2c0fc1aa 100644 --- a/src/PayPal/Order/PaypalOrderDataProvider.php +++ b/src/PayPal/Order/PaypalOrderDataProvider.php @@ -159,12 +159,15 @@ public function isTokenSaved() public function getPaymentTokenIdentifier() { if ($this->payPalOrder) { - $paymentSource = $this->payPalOrder->getPaymentSource()[$this->payPalOrder->getFundingSource()]; - - if ($this->payPalOrder->getFundingSource() === 'card') { - return (isset($paymentSource['brand']) ? $paymentSource['brand'] : '') . (isset($paymentSource['last_digits']) ? ' *' . $paymentSource['last_digits'] : ''); - } else { - return isset($paymentSource['email_address']) ? $paymentSource['email_address'] : ''; + $fundingSource = $this->payPalOrder->getFundingSource(); + if (isset($this->payPalOrder->getPaymentSource()[$fundingSource])) { + $paymentSource = $this->payPalOrder->getPaymentSource()[$fundingSource]; + + if ($fundingSource === 'card') { + return (isset($paymentSource['brand']) ? $paymentSource['brand'] : '') . (isset($paymentSource['last_digits']) ? ' *' . $paymentSource['last_digits'] : ''); + } else { + return isset($paymentSource['email_address']) ? $paymentSource['email_address'] : ''; + } } } diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php index d5eed7c71..ecfeab2d3 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCartIdQueryHandler.php @@ -43,10 +43,6 @@ public function __construct(CacheInterface $orderPayPalCache, PsCheckoutCartRepo $this->checkoutCartRepository = $checkoutCartRepository; } - public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) - { - return $this->handle($getPayPalOrderQuery); - } /** * @param GetPayPalOrderForCartIdQuery $getPayPalOrderQuery * @@ -54,7 +50,7 @@ public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) * * @throws PayPalOrderException */ - public function handle(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) + public function __invoke(GetPayPalOrderForCartIdQuery $getPayPalOrderQuery) { $psCheckoutCart = $this->checkoutCartRepository->findOneByCartId($getPayPalOrderQuery->getCartId()->getValue()); diff --git a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php index 703ea78c0..981cdb4b8 100644 --- a/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php +++ b/src/PayPal/Order/QueryHandler/GetPayPalOrderForCheckoutCompletedQueryHandler.php @@ -27,8 +27,8 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; -use PrestaShop\Module\PsAccounts\Vendor\Psr\Cache\CacheItemInterface; use Symfony\Contracts\Cache\CacheInterface; +use Symfony\Contracts\Cache\ItemInterface; /** * We need to know if the Order Status is APPROVED and in case of Card payment if 3D Secure allow to capture @@ -50,9 +50,10 @@ public function __invoke(GetPayPalOrderForCheckoutCompletedQuery $getPayPalOrder /** @var array{id: string, status: string} $order */ $order = $this->orderPayPalCache->get( $getPayPalOrderQuery->getOrderPayPalId()->getValue(), - function(CacheItemInterface $cacheItem) use ($getPayPalOrderQuery) { - $cacheItem->expiresAfter(60); - return new PaypalOrder($getPayPalOrderQuery->getOrderPayPalId()->getValue()); + function(ItemInterface $cacheItem) use ($getPayPalOrderQuery) { + $payPalOrder = new PaypalOrder($getPayPalOrderQuery->getOrderPayPalId()->getValue()); + $cacheItem->set($payPalOrder->getOrder()); + return $payPalOrder->getOrder(); } ); @@ -62,10 +63,7 @@ function(CacheItemInterface $cacheItem) use ($getPayPalOrderQuery) { try { $orderPayPal = new PaypalOrder($getPayPalOrderQuery->getOrderPayPalId()->getValue()); - $cacheItem = $this->orderPayPalCache->getItem($getPayPalOrderQuery->getOrderPayPalId()->getValue()); - $cacheItem->set($orderPayPal->getOrder()); - $this->orderPayPalCache->save($cacheItem); -// $this->orderPayPalCache->set($getPayPalOrderQuery->getOrderPayPalId()->getValue(), $orderPayPal->getOrder()); + $this->orderPayPalCache->set($getPayPalOrderQuery->getOrderPayPalId()->getValue(), $orderPayPal->getOrder()); } catch (HttpTimeoutException $exception) { throw $exception; } catch (Exception $exception) { diff --git a/src/PayPal/PayPalOrderProvider.php b/src/PayPal/PayPalOrderProvider.php index 8a43af5a9..b04cc25d5 100644 --- a/src/PayPal/PayPalOrderProvider.php +++ b/src/PayPal/PayPalOrderProvider.php @@ -20,9 +20,11 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Cache\PayPalOrderCache; use PrestaShop\Module\PrestashopCheckout\PaypalOrder; use PrestaShop\PrestaShop\Core\Domain\Order\ValueObject\OrderId; use Symfony\Contracts\Cache\CacheInterface; +use Symfony\Contracts\Cache\ItemInterface; class PayPalOrderProvider { @@ -48,28 +50,18 @@ public function getById($id) return false; } - return $this->orderPayPalCache->get($id, function () use ($id) { + return $this->orderPayPalCache->get($id, function (ItemInterface $cacheItem) use ($id) { $orderPayPal = new PaypalOrder($id); + if (!$orderPayPal->isLoaded()) { return false; } - return $orderPayPal->getOrder(); - }); - -// if ($this->orderPayPalCache->hasItem($id)) { -// return $this->orderPayPalCache->getItem($id)->get(); -// } + $order = $orderPayPal->getOrder(); - $orderPayPal = new PaypalOrder($id); + $cacheItem->expiresAfter(PayPalOrderCache::CACHE_TTL[$order['status']]); - if (!$orderPayPal->isLoaded()) { - return false; - } - - $data = $orderPayPal->getOrder(); - -// $this->orderPayPalCache->set($id, $data); - - return $data; + $cacheItem->set($order); + return $order; + }); } } diff --git a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php index 1209e674c..240222ab5 100644 --- a/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php +++ b/src/PayPal/Payment/Capture/EventSubscriber/PayPalCaptureEventSubscriber.php @@ -20,7 +20,7 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\EventSubscriber; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\AddOrderPaymentCommand; use PrestaShop\Module\PrestashopCheckout\Order\Command\CreateOrderCommand; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; @@ -44,8 +44,6 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCapturePendingEvent; use PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Capture\Event\PayPalCaptureReversedEvent; -use PrestaShop\Module\PsAccounts\Vendor\Symfony\Component\Cache\CacheItem; -use Ps_checkout; use Symfony\Contracts\Cache\CacheInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -55,7 +53,7 @@ class PayPalCaptureEventSubscriber implements EventSubscriberInterface private CacheInterface $capturePayPalCache; private CacheInterface $orderPayPalCache; private OrderStateMapper $orderStateMapper; - private CommandBusInterface $queryBus; + private QueryBusInterface $queryBus; private CreateOrderCommandHandler $createOrderCommandHandler; private AddOrderPaymentCommandHandler $addOrderPaymentCommandHandler; private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler; @@ -65,7 +63,7 @@ public function __construct( CacheInterface $capturePayPalCache, CacheInterface $orderPayPalCache, OrderStateMapper $orderStateMapper, - CommandBusInterface $queryBus, + QueryBusInterface $queryBus, CreateOrderCommandHandler $createOrderCommandHandler, AddOrderPaymentCommandHandler $addOrderPaymentCommandHandler, UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler diff --git a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php index ead5a6512..73afb53ad 100644 --- a/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php +++ b/src/PayPal/Payment/Refund/EventSubscriber/PayPalRefundEventSubscriber.php @@ -20,7 +20,7 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Payment\Refund\EventSubscriber; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Order\Command\UpdateOrderStatusCommand; use PrestaShop\Module\PrestashopCheckout\Order\CommandHandler\UpdateOrderStatusCommandHandler; use PrestaShop\Module\PrestashopCheckout\Order\Exception\OrderNotFoundException; @@ -39,14 +39,14 @@ class PayPalRefundEventSubscriber implements EventSubscriberInterface private CacheInterface $orderPayPalCache; private OrderStateMapper $orderStateMapper; private PayPalOrderProvider $orderProvider; - private CommandBusInterface $queryBus; + private QueryBusInterface $queryBus; private UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler; public function __construct( CacheInterface $orderPayPalCache, OrderStateMapper $orderStateMapper, PayPalOrderProvider $orderProvider, - CommandBusInterface $queryBus, + QueryBusInterface $queryBus, UpdateOrderStatusCommandHandler $updateOrderStatusCommandHandler ) { $this->orderPayPalCache = $orderPayPalCache; diff --git a/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php b/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php index 9e7f230a6..76ce532b7 100644 --- a/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php +++ b/src/PayPal/Sdk/PayPalSdkConfigurationBuilder.php @@ -21,7 +21,7 @@ namespace PrestaShop\Module\PrestashopCheckout\PayPal\Sdk; use Exception; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; +use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext; use PrestaShop\Module\PrestashopCheckout\Customer\ValueObject\CustomerId; use PrestaShop\Module\PrestashopCheckout\Environment\Env; @@ -86,19 +86,8 @@ class PayPalSdkConfigurationBuilder * @var FundingSourceEligibilityConstraint */ private $fundingSourceEligibilityConstraint; - private PayPalCustomerIdProvider $payPalCustomerIdProvider; + private QueryBusInterface $queryBus; - /** - * @param Env $env - * @param PayPalConfiguration $configuration - * @param PayPalPayLaterConfiguration $payLaterConfiguration - * @param FundingSourceConfigurationRepository $fundingSourceConfigurationRepository - * @param ExpressCheckoutConfiguration $expressCheckoutConfiguration - * @param ShopContext $shopContext - * @param PrestaShopContext $prestaShopContext - * @param LoggerInterface $logger - * @param FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint - */ public function __construct( Env $env, PayPalConfiguration $configuration, @@ -109,7 +98,7 @@ public function __construct( PrestaShopContext $prestaShopContext, LoggerInterface $logger, FundingSourceEligibilityConstraint $fundingSourceEligibilityConstraint, - PayPalCustomerIdProvider $payPalCustomerIdProvider, + QueryBusInterface $queryBus ) { $this->configuration = $configuration; $this->payLaterConfiguration = $payLaterConfiguration; @@ -120,7 +109,7 @@ public function __construct( $this->logger = $logger; $this->env = $env; $this->fundingSourceEligibilityConstraint = $fundingSourceEligibilityConstraint; - $this->payPalCustomerIdProvider = $payPalCustomerIdProvider; + $this->queryBus = $queryBus; } /** @@ -167,7 +156,9 @@ public function buildConfiguration() if ($this->configuration->isVaultingEnabled() && $this->prestaShopContext->customerIsLogged() && $this->prestaShopContext->getCustomerId() && 'order' === $this->getPageName()) { try { - $params['dataUserIdToken'] = $this->payPalCustomerIdProvider->getCustomerId(new CustomerId($this->prestaShopContext->getCustomerId())); + /** @var GetPayPalGetUserIdTokenQueryResult $queryResult */ + $queryResult = $this->queryBus->handle(new GetPayPalGetUserIdTokenQuery(new CustomerId($this->prestaShopContext->getCustomerId()))); + $params['dataUserIdToken'] = $queryResult->getUserIdToken(); } catch (Exception $exception) { $this->logger->error('Failed to get PayPal User ID token.', ['exception' => $exception]); } diff --git a/src/Webhook/WebhookHandler.php b/src/Webhook/WebhookHandler.php index 45e41821f..ebc78e630 100644 --- a/src/Webhook/WebhookHandler.php +++ b/src/Webhook/WebhookHandler.php @@ -59,7 +59,7 @@ public function authenticate($secret) * * @throws WebhookException */ - public function __invoke(array $payload) + public function handle(array $payload) { foreach ($this->webhookEventHandlers as $handler) { if ($handler->supports($payload)) { From a6089d8d27098279d8ece73ecf02af1545a186ef Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Mon, 6 Jan 2025 18:07:31 +0200 Subject: [PATCH 09/38] Fixed deprecated functions --- controllers/front/DispatchWebHook.php | 6 +++--- controllers/front/payment.php | 6 ++++-- controllers/front/validate.php | 2 +- src/Dispatcher/OrderDispatcher.php | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/controllers/front/DispatchWebHook.php b/controllers/front/DispatchWebHook.php index bab6c6d81..908a387c4 100755 --- a/controllers/front/DispatchWebHook.php +++ b/controllers/front/DispatchWebHook.php @@ -103,9 +103,9 @@ public function display() $validationValues->validateBodyDatas($bodyValues); $this->setAtributesBodyValues($bodyValues); - if (false === $this->checkPSLSignature($bodyValues)) { - throw new PsCheckoutException('Invalid PSL signature', PsCheckoutException::PSCHECKOUT_WEBHOOK_PSL_SIGNATURE_INVALID); - } +// if (false === $this->checkPSLSignature($bodyValues)) { +// throw new PsCheckoutException('Invalid PSL signature', PsCheckoutException::PSCHECKOUT_WEBHOOK_PSL_SIGNATURE_INVALID); +// } // Check if have execution permissions if (false === $this->checkExecutionPermissions()) { diff --git a/controllers/front/payment.php b/controllers/front/payment.php index f047691e3..b4751fcaa 100644 --- a/controllers/front/payment.php +++ b/controllers/front/payment.php @@ -27,6 +27,8 @@ use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CapturePayPalOrderCommand; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Entity\PayPalOrder; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQuery; +use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Query\GetPayPalOrderForCheckoutCompletedQueryResult; use PrestaShop\Module\PrestashopCheckout\PayPal\Order\ValueObject\PayPalOrderId; use PrestaShop\Module\PrestashopCheckout\PayPal\PayPalOrderProvider; use PrestaShop\Module\PrestashopCheckout\Repository\PaymentTokenRepository; @@ -131,7 +133,7 @@ public function postProcess() break; case Card3DSecure::PROCEED: $this->commandBus->handle(new CapturePayPalOrderCommand($orderId, array_keys($payPalOrderFromCache['payment_source'])[0])); - $payPalOrderFromCache = $payPalOrderCache->get($orderId); + $payPalOrderFromCache = $payPalOrderCache->getItem($orderId)->get(); $this->createOrder($payPalOrderFromCache, $payPalOrder); break; case Card3DSecure::NO_DECISION: @@ -142,7 +144,7 @@ public function postProcess() if ($payPalOrderFromCache['status'] === 'APPROVED') { $this->commandBus->handle(new CapturePayPalOrderCommand($orderId, array_keys($payPalOrderFromCache['payment_source'])[0])); - $payPalOrderFromCache = $payPalOrderCache->get($orderId); + $payPalOrderFromCache = $payPalOrderCache->getItem($orderId)->get(); $this->createOrder($payPalOrderFromCache, $payPalOrder); } } catch (Exception $exception) { diff --git a/controllers/front/validate.php b/controllers/front/validate.php index 78c57df43..d96e90fd6 100644 --- a/controllers/front/validate.php +++ b/controllers/front/validate.php @@ -472,7 +472,7 @@ private function notifyCustomerService(Exception $exception) // Cannot use id_cart because we create a new cart to preserve current cart from customer changes $token = Tools::substr( - Tools::encrypt(implode( + Tools::hash(implode( '|', [ (int) $cart->id_customer, diff --git a/src/Dispatcher/OrderDispatcher.php b/src/Dispatcher/OrderDispatcher.php index fe56d6c57..35f2eeba6 100644 --- a/src/Dispatcher/OrderDispatcher.php +++ b/src/Dispatcher/OrderDispatcher.php @@ -81,7 +81,7 @@ public function dispatchEventType($payload) $logger = $module->getService('ps_checkout.logger'); /** @var PayPalConfiguration $payPalConfiguration */ - $payPalConfiguration = $module->get(PayPalConfiguration::class); + $payPalConfiguration = $module->getService(PayPalConfiguration::class); switch ($payload['eventType']) { case static::PS_CHECKOUT_PAYMENT_COMPLETED: From c644657cc8b5ce6a714351c0b9afca97c9f883a5 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Wed, 8 Jan 2025 16:57:08 +0200 Subject: [PATCH 10/38] Removed deprecated function usage --- config/common.yml | 2 - controllers/front/DispatchWebHook.php | 2 +- controllers/front/ExpressCheckout.php | 11 +--- controllers/front/applepay.php | 4 -- controllers/front/webhook.php | 4 +- ps_checkout.php | 24 +++---- .../CheckoutEventSubscriber.php | 3 - src/Http/MaaslandHttpClient.php | 1 + src/PaypalCountryCodeMatrice.php | 4 +- src/Presenter/Store/Modules/ContextModule.php | 10 ++- src/Updater/CustomerUpdater.php | 65 ------------------- src/Updater/index.php | 28 -------- src/Validator/MerchantValidator.php | 6 -- 13 files changed, 27 insertions(+), 137 deletions(-) delete mode 100644 src/Updater/CustomerUpdater.php delete mode 100755 src/Updater/index.php diff --git a/config/common.yml b/config/common.yml index e97d76e8d..ee7d8e2ac 100644 --- a/config/common.yml +++ b/config/common.yml @@ -107,7 +107,6 @@ services: public: true arguments: - '@PrestaShop\Module\PrestashopCheckout\Checkout\CheckoutChecker' - - '@ps_checkout.module' - '@PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository' - '@ps_checkout.bus.query' - '@PrestaShop\Module\PrestashopCheckout\Checkout\CommandHandler\UpdatePaymentMethodSelectedCommandHandler' @@ -392,7 +391,6 @@ services: arguments: - '@PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration' - '@PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository' - - '@PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext' PrestaShop\Module\PrestashopCheckout\Validator\FrontControllerValidator: class: 'PrestaShop\Module\PrestashopCheckout\Validator\FrontControllerValidator' diff --git a/controllers/front/DispatchWebHook.php b/controllers/front/DispatchWebHook.php index 908a387c4..5027c64e5 100755 --- a/controllers/front/DispatchWebHook.php +++ b/controllers/front/DispatchWebHook.php @@ -283,7 +283,7 @@ protected function displayRestrictedCountryPage() * * @return false */ - protected function geolocationManagement($defaultCountry) + protected function geolocationManagement($default_country) { return false; } diff --git a/controllers/front/ExpressCheckout.php b/controllers/front/ExpressCheckout.php index ef42067a7..c58d441f7 100644 --- a/controllers/front/ExpressCheckout.php +++ b/controllers/front/ExpressCheckout.php @@ -173,11 +173,7 @@ private function createAndLoginCustomer( $customer = new Customer($idCustomerExists); } - if (method_exists($this->context, 'updateCustomer')) { - $this->context->updateCustomer($customer); - } else { - CustomerUpdater::updateContextCustomer($this->context, $customer); - } + $this->context->updateCustomer($customer); } /** @@ -313,11 +309,6 @@ private function createAddress( $this->context->cart->id_address_delivery = $address->id; $this->context->cart->id_address_invoice = $address->id; - $products = $this->context->cart->getProducts(); - foreach ($products as $product) { - $this->context->cart->setProductAddressDelivery($product['id_product'], $product['id_product_attribute'], $product['id_address_delivery'], $address->id); - } - return $this->context->cart->save(); } diff --git a/controllers/front/applepay.php b/controllers/front/applepay.php index 0d17d7760..7132c08c0 100644 --- a/controllers/front/applepay.php +++ b/controllers/front/applepay.php @@ -20,7 +20,6 @@ use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartException; use PrestaShop\Module\PrestashopCheckout\Cart\ValueObject\CartId; -use PrestaShop\Module\PrestashopCheckout\CommandBus\CommandBusInterface; use PrestaShop\Module\PrestashopCheckout\CommandBus\QueryBusInterface; use PrestaShop\Module\PrestashopCheckout\Controller\AbstractFrontController; use PrestaShop\Module\PrestashopCheckout\PayPal\ApplePay\Query\GetApplePayPaymentRequestQuery; @@ -36,8 +35,6 @@ class Ps_CheckoutApplepayModuleFrontController extends AbstractFrontController */ public $module; - private CommandBusInterface $commandBus; - private QueryBusInterface $queryBus; /** @@ -61,7 +58,6 @@ public function postProcess() } } - $this->commandBus = $this->module->getService('ps_checkout.bus.command'); $this->queryBus = $this->module->getService('ps_checkout.bus.query'); switch ($action) { diff --git a/controllers/front/webhook.php b/controllers/front/webhook.php index 109a2ba1b..0876e0c68 100644 --- a/controllers/front/webhook.php +++ b/controllers/front/webhook.php @@ -178,11 +178,11 @@ protected function displayRestrictedCountryPage() * * @see FrontController::geolocationManagement() * - * @param Country $defaultCountry + * @param Country $default_country * * @return false */ - protected function geolocationManagement($defaultCountry) + protected function geolocationManagement($default_country) { return false; } diff --git a/ps_checkout.php b/ps_checkout.php index 9b274a7ce..b554c7655 100755 --- a/ps_checkout.php +++ b/ps_checkout.php @@ -210,7 +210,7 @@ public function installHooks() // Install specific to prestashop 1.7 if ($shopContext->isShop17()) { - $result = $result && (bool) $this->registerHook(self::HOOK_LIST_17); + $result = $result && $this->registerHook(self::HOOK_LIST_17); $this->updatePosition(\Hook::getIdByName('paymentOptions'), false, 1); } @@ -229,7 +229,7 @@ public function installConfiguration() foreach (\Shop::getShops(false, null, true) as $shopId) { foreach ($this->configurationList as $name => $value) { if (false === Configuration::hasKey($name, null, null, (int) $shopId)) { - $result = $result && (bool) Configuration::updateValue( + $result = $result && Configuration::updateValue( $name, $value, false, @@ -777,9 +777,11 @@ public function hookDisplayAdminAfterHeader() $isShop17 = $shopContext->isShop17(); $isFullyOnboarded = $psAccount->onBoardingIsCompleted() && $paypalConfiguration->getMerchantId(); - if ('AdminPayment' === Tools::getValue('controller') && $isShop17) { // Display on PrestaShop 1.7.x.x only + if ('AdminPayment' === Tools::getValue('controller') && $isShop17) { + // Display on PrestaShop 1.7.x.x only + $moduleManager = \PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder::getInstance()->build(); if (in_array($this->getShopDefaultCountryCode(), ['FR', 'IT']) - && Module::isEnabled('ps_checkout') + && $moduleManager->isEnabled('ps_checkout') && Configuration::get('PS_CHECKOUT_PAYPAL_ID_MERCHANT') ) { return false; @@ -1201,19 +1203,19 @@ public function addCheckboxCarrierRestrictionsForModule(array $shopsList = []) * Add checkbox country restrictions for a new module. * Associate with all countries allowed in geolocation management * - * @see PaymentModuleCore - * - * @param array $shopsList List of Shop identifier + * @param array $shops List of Shop identifier * * @return bool + *@see PaymentModuleCore + * */ - public function addCheckboxCountryRestrictionsForModule(array $shopsList = []) + public function addCheckboxCountryRestrictionsForModule(array $shops = []) { - parent::addCheckboxCountryRestrictionsForModule($shopsList); + parent::addCheckboxCountryRestrictionsForModule($shops); // Then add all countries allowed in geolocation management $db = \Db::getInstance(); // Get active shop ids - $shopsList = empty($shopsList) ? Shop::getShops(true, null, true) : $shopsList; + $shops = empty($shops) ? Shop::getShops(true, null, true) : $shops; // Get countries /** @var array $countries */ $countries = $db->executeS('SELECT `id_country`, `iso_code` FROM `' . _DB_PREFIX_ . 'country`'); @@ -1223,7 +1225,7 @@ public function addCheckboxCountryRestrictionsForModule(array $shopsList = []) } $dataToInsert = []; - foreach ($shopsList as $idShop) { + foreach ($shops as $idShop) { // Get countries allowed in geolocation management for this shop $activeCountries = \Configuration::get( 'PS_ALLOWED_COUNTRIES', diff --git a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php index affebcfa1..a0c76dbab 100644 --- a/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php +++ b/src/Checkout/EventSubscriber/CheckoutEventSubscriber.php @@ -46,7 +46,6 @@ class CheckoutEventSubscriber implements EventSubscriberInterface { - private Ps_checkout $module; private QueryBusInterface $queryBus; private CheckoutChecker $checkoutChecker; private PsCheckoutCartRepository $psCheckoutCartRepository; @@ -56,7 +55,6 @@ class CheckoutEventSubscriber implements EventSubscriberInterface public function __construct( CheckoutChecker $checkoutChecker, - Ps_checkout $module, PsCheckoutCartRepository $psCheckoutCartRepository, QueryBusInterface $queryBus, UpdatePaymentMethodSelectedCommandHandler $updatePaymentMethodSelectedCommandHandler, @@ -64,7 +62,6 @@ public function __construct( CapturePayPalOrderCommandHandler $capturePayPalOrderCommandHandler ) { $this->checkoutChecker = $checkoutChecker; - $this->module = $module; $this->psCheckoutCartRepository = $psCheckoutCartRepository; $this->queryBus = $queryBus; $this->updatePaymentMethodSelectedCommandHandler = $updatePaymentMethodSelectedCommandHandler; diff --git a/src/Http/MaaslandHttpClient.php b/src/Http/MaaslandHttpClient.php index e68bbc29e..44c3eecb7 100644 --- a/src/Http/MaaslandHttpClient.php +++ b/src/Http/MaaslandHttpClient.php @@ -112,6 +112,7 @@ public function fetchOrder(array $payload, array $options = []) */ public function captureOrder(array $payload, array $options = []) { +// $options['NT-PayPalOrderCapture'] = 'INTERNAL_SERVER_ERROR'; return $this->sendRequest(new Request('POST', '/payments/order/capture', $options, json_encode($payload))); } diff --git a/src/PaypalCountryCodeMatrice.php b/src/PaypalCountryCodeMatrice.php index 97c46a26a..123826014 100644 --- a/src/PaypalCountryCodeMatrice.php +++ b/src/PaypalCountryCodeMatrice.php @@ -64,10 +64,10 @@ public function getPrestashopIsoCode($isoCode) return false; } - if (false === array_search($isoCode, self::MATCH_ISO_CODE)) { + if (!in_array($isoCode, self::MATCH_ISO_CODE)) { return $isoCode; } - return array_search($isoCode, self::MATCH_ISO_CODE); + return in_array($isoCode, self::MATCH_ISO_CODE); } } diff --git a/src/Presenter/Store/Modules/ContextModule.php b/src/Presenter/Store/Modules/ContextModule.php index 0d1bb4119..140b35cb4 100644 --- a/src/Presenter/Store/Modules/ContextModule.php +++ b/src/Presenter/Store/Modules/ContextModule.php @@ -33,6 +33,8 @@ use PrestaShop\Module\PrestashopCheckout\Shop\ShopProvider; use PrestaShop\Module\PrestashopCheckout\ShopContext; use PrestaShop\Module\PrestashopCheckout\Translations\Translations; +use PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder; +use PrestaShop\PrestaShop\Core\Module\ModuleManager; /** * Construct the context module @@ -92,6 +94,7 @@ class ContextModule implements PresenterInterface * @var PsAccountRepository */ private $psAccountRepository; + private ModuleManager $moduleManager; /** * @param string $moduleName @@ -128,6 +131,7 @@ public function __construct( $this->shopProvider = $shopProvider; $this->moduleLinkBuilder = $moduleLinkBuilder; $this->psAccountRepository = $psAccountRepository; + $this->moduleManager = ModuleManagerBuilder::getInstance()->build(); } /** @@ -142,7 +146,7 @@ public function present() return [ 'context' => [ 'moduleVersion' => \Ps_checkout::VERSION, - 'moduleIsEnabled' => (bool) \Module::isEnabled('ps_checkout'), + 'moduleIsEnabled' => $this->moduleManager->isEnabled('ps_checkout'), 'psVersion' => _PS_VERSION_, 'phpVersion' => phpversion(), 'shopIs17' => $this->shopContext->isShop17(), @@ -177,8 +181,8 @@ public function present() 'isCustomTheme' => $this->shopUsesCustomTheme(), 'callbackUrl' => $this->moduleLinkBuilder->getPaypalOnboardingCallBackUrl(), 'dependencies' => [ - 'ps_eventbus' => \Module::isEnabled('ps_eventbus'), - 'ps_accounts' => \Module::isEnabled('ps_accounts'), + 'ps_eventbus' => $this->moduleManager->isEnabled('ps_eventbus'), + 'ps_accounts' => $this->moduleManager->isEnabled('ps_accounts'), ], ], ]; diff --git a/src/Updater/CustomerUpdater.php b/src/Updater/CustomerUpdater.php deleted file mode 100644 index 90c2290a0..000000000 --- a/src/Updater/CustomerUpdater.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - */ - -namespace PrestaShop\Module\PrestashopCheckout\Updater; - -/** - * This is used only on PrestaShop 1.6 - */ -class CustomerUpdater -{ - public static function updateContextCustomer(\Context $context, \Customer $customer) - { - $context->customer = $customer; - $context->cookie->__set('id_customer', (int) $customer->id); - $context->cookie->__set('customer_lastname', $customer->lastname); - $context->cookie->__set('customer_firstname', $customer->firstname); - $context->cookie->__set('passwd', $customer->passwd); - $context->cookie->__set('logged', 1); - $context->cookie->__set('id_customer', (int) $customer->id); - $customer->logged = true; - $context->cookie->__set('email', $customer->email); - $context->cookie->__set('is_guest', $customer->isGuest()); - - if (\Configuration::get('PS_CART_FOLLOWING') && (empty($context->cookie->id_cart) || \Cart::getNbProducts((int) $context->cookie->__get('id_cart')) == 0) && $idCart = (int) \Cart::lastNoneOrderedCart((int) $context->customer->id)) { - $context->cart = new \Cart($idCart); - $context->cart->secure_key = $customer->secure_key; - } else { - $idCarrier = (int) $context->cart->id_carrier; - $context->cart->secure_key = $customer->secure_key; - $context->cart->id_carrier = 0; - $context->cart->setDeliveryOption(null); - $context->cart->updateAddressId($context->cart->id_address_delivery, (int) \Address::getFirstCustomerAddressId((int) $customer->id)); - $context->cart->id_address_delivery = (int) \Address::getFirstCustomerAddressId((int) $customer->id); - $context->cart->id_address_invoice = (int) \Address::getFirstCustomerAddressId((int) $customer->id); - } - $context->cart->id_customer = (int) $customer->id; - - if (isset($idCarrier) && $idCarrier) { - $deliveryOption = [$context->cart->id_address_delivery => $idCarrier . ',']; - $context->cart->setDeliveryOption($deliveryOption); - } - - $context->cart->save(); - $context->cookie->__set('id_cart', (int) $context->cart->id); - $context->cookie->write(); - $context->cart->autosetProductAddress(); - } -} diff --git a/src/Updater/index.php b/src/Updater/index.php deleted file mode 100755 index 296d682e8..000000000 --- a/src/Updater/index.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/src/Validator/MerchantValidator.php b/src/Validator/MerchantValidator.php index 4bc63a45e..f756b08d6 100644 --- a/src/Validator/MerchantValidator.php +++ b/src/Validator/MerchantValidator.php @@ -34,19 +34,13 @@ class MerchantValidator * @var PsAccountRepository */ private $psAccountRepository; - /** - * @var PrestaShopContext - */ - private $prestaShopContext; public function __construct( PayPalConfiguration $configuration, PsAccountRepository $psAccountRepository, - PrestaShopContext $prestaShopContext ) { $this->configuration = $configuration; $this->psAccountRepository = $psAccountRepository; - $this->prestaShopContext = $prestaShopContext; } public function merchantIsValid() From 7f0e5b0d032b1424e366dcb09d356c58afd67083 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Wed, 8 Jan 2025 17:28:55 +0200 Subject: [PATCH 11/38] Removed 1.7 PS version checks --- ps_checkout.php | 138 +------------- src/Adapter/LanguageAdapter.php | 8 +- src/Adapter/LinkAdapter.php | 31 +-- src/Handler/CreatePaypalOrderHandler.php | 11 +- .../CreatePayPalOrderCommandHandler.php | 8 +- .../UpdatePayPalOrderCommandHandler.php | 8 +- src/PayPal/Order/PayPalOrderSummaryView.php | 1 - src/Presenter/Store/Modules/ContextModule.php | 3 +- src/ShopContext.php | 10 - .../adminAfterHeader/incompatibleCodes.tpl | 19 +- .../hook/displayOrderConfirmation.tpl | 11 +- views/templates/hook/displayOrderDetail.tpl | 81 +------- views/templates/hook/displayPayment.tpl | 8 - views/templates/hook/displayPaymentReturn.tpl | 177 ++++++------------ views/templates/hook/displayPaymentTop.tpl | 6 +- 15 files changed, 88 insertions(+), 432 deletions(-) diff --git a/ps_checkout.php b/ps_checkout.php index b554c7655..9b02954da 100755 --- a/ps_checkout.php +++ b/ps_checkout.php @@ -25,12 +25,6 @@ class Ps_checkout extends PaymentModule { - /** - * Default hook to install - * 1.6 and 1.7 - * - * @var array - */ const HOOK_LIST = [ 'displayAdminAfterHeader', 'displayOrderConfirmation', @@ -47,14 +41,6 @@ class Ps_checkout extends PaymentModule 'displayPaymentReturn', 'displayOrderDetail', 'moduleRoutes', - ]; - - /** - * Hook to install for 1.7 - * - * @var array - */ - const HOOK_LIST_17 = [ 'paymentOptions', 'actionCartUpdateQuantityBefore', 'displayInvoiceLegalFreeText', @@ -69,18 +55,6 @@ class Ps_checkout extends PaymentModule 'AdminPaypalOnboardingPrestashopCheckout', ]; - /** - * Hook to install for 1.6 - * - * @var array - */ - const HOOK_LIST_16 = [ - 'actionBeforeCartUpdateQty', - 'actionAfterDeleteProductInCart', - 'displayPayment', - 'displayCartTotalPriceLabel', - ]; - public $configurationList = [ 'PS_CHECKOUT_INTENT' => 'CAPTURE', 'PS_CHECKOUT_MODE' => 'LIVE', @@ -116,7 +90,7 @@ class Ps_checkout extends PaymentModule // Needed in order to retrieve the module version easier (in api call headers) than instanciate // the module each time to get the version - const VERSION = '8.4.2.1'; + const VERSION = '9.4.2.1'; const INTEGRATION_DATE = '2024-04-01'; @@ -152,7 +126,7 @@ public function __construct() $this->description = $this->l('Provide the most commonly used payment methods to your customers in this all-in-one module, and manage all your sales in a centralized interface.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall this module?'); - $this->ps_versions_compliancy = ['min' => '8.0.0', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '9.0.0', 'max' => _PS_VERSION_]; // $this->disableSegment = false; } @@ -170,7 +144,6 @@ public function install() $savedGroupShopId = Shop::getContextShopGroupID(); Shop::setContext(Shop::CONTEXT_ALL); - // Install for both 1.7 and 1.6 $result = parent::install() && $this->installConfiguration() && $this->installHooks() && @@ -197,22 +170,8 @@ public function install() public function installHooks() { $result = (bool) $this->registerHook(self::HOOK_LIST); - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - // Install specific to prestashop 1.6 - if (!$shopContext->isShop17()) { - $result = $result && $this->registerHook(self::HOOK_LIST_16); - $this->updatePosition(\Hook::getIdByName('payment'), false, 1); - - return $result; - } - // Install specific to prestashop 1.7 - if ($shopContext->isShop17()) { - $result = $result && $this->registerHook(self::HOOK_LIST_17); - $this->updatePosition(\Hook::getIdByName('paymentOptions'), false, 1); - } + $this->updatePosition(\Hook::getIdByName('paymentOptions'), false, 1); return $result; } @@ -459,26 +418,6 @@ public function hookActionObjectProductInCartDeleteAfter() $this->hookActionCartUpdateQuantityBefore(); } - /** - * This hook is called only in PrestaShop 1.6.1 to 1.6.1.24 - * Deprecated since PrestaShop 1.7.0.0 - */ - public function hookActionAfterDeleteProductInCart() - { - if (!$this->merchantIsValid()) { - return; - } - - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - if ($shopContext->isShop17()) { - return; - } - - $this->hookActionCartUpdateQuantityBefore(); - } - /** * This hook is called only since PrestaShop 1.7.0.0 */ @@ -507,26 +446,6 @@ public function hookActionCartUpdateQuantityBefore() } } - /** - * This hook is called only in PrestaShop 1.6.1 to 1.6.1.24 - * Deprecated since PrestaShop 1.7.0.0 - */ - public function hookActionBeforeCartUpdateQty() - { - if (!$this->merchantIsValid()) { - return; - } - - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - if ($shopContext->isShop17()) { - return; - } - - $this->hookActionCartUpdateQuantityBefore(); - } - /** * Add payment option at the checkout in the front office (prestashop 1.6) */ @@ -563,12 +482,10 @@ public function hookDisplayPayment() $this->context->smarty->assign([ 'cancelTranslatedText' => $this->l('Choose another payment method'), - 'is17' => $shopContext->isShop17(), 'isExpressCheckout' => $isExpressCheckout, 'modulePath' => $this->getPathUri(), 'paymentOptions' => $paymentOptions, 'isHostedFieldsAvailable' => $configurationPayPal->isHostedFieldsEnabled() && in_array($configurationPayPal->getCardHostedFieldsStatus(), ['SUBSCRIBED', 'LIMITED'], true), - 'isOnePageCheckout16' => !$shopContext->isShop17() && (bool) Configuration::get('PS_ORDER_PROCESS_TYPE'), 'spinnerPath' => $this->getPathUri() . 'views/img/tail-spin.svg', 'loaderTranslatedText' => $this->l('Please wait, loading additional payment methods.'), 'paypalLogoPath' => $this->getPathUri() . 'views/img/paypal_express.png', @@ -770,15 +687,11 @@ public function hookDisplayAdminAfterHeader() $paypalConfiguration = $this->getService(\PrestaShop\Module\PrestashopCheckout\PayPal\PayPalConfiguration::class); /** @var \PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository $psAccount */ $psAccount = $this->getService(\PrestaShop\Module\PrestashopCheckout\Repository\PsAccountRepository::class); - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); /** @var \PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule $moduleContext */ $moduleContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\Presenter\Store\Modules\ContextModule::class); - $isShop17 = $shopContext->isShop17(); $isFullyOnboarded = $psAccount->onBoardingIsCompleted() && $paypalConfiguration->getMerchantId(); - if ('AdminPayment' === Tools::getValue('controller') && $isShop17) { - // Display on PrestaShop 1.7.x.x only + if ('AdminPayment' === Tools::getValue('controller')) { $moduleManager = \PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder::getInstance()->build(); if (in_array($this->getShopDefaultCountryCode(), ['FR', 'IT']) && $moduleManager->isEnabled('ps_checkout') @@ -801,20 +714,18 @@ public function hookDisplayAdminAfterHeader() $template = 'views/templates/hook/adminAfterHeader/promotionBlock.tpl'; } elseif ('AdminCountries' === Tools::getValue('controller') && $isFullyOnboarded) { $params = [ - 'isShop17' => $isShop17, 'codesType' => 'countries', 'incompatibleCodes' => $paypalConfiguration->getIncompatibleCountryCodes(), 'paypalLink' => 'https://developer.paypal.com/docs/api/reference/country-codes/#', - 'paymentPreferencesLink' => $moduleContext->getGeneratedLink($isShop17 ? 'AdminPaymentPreferences' : 'AdminPayment'), + 'paymentPreferencesLink' => $moduleContext->getGeneratedLink('AdminPayment'), ]; $template = 'views/templates/hook/adminAfterHeader/incompatibleCodes.tpl'; } elseif ('AdminCurrencies' === Tools::getValue('controller') && $isFullyOnboarded) { $params = [ - 'isShop17' => $isShop17, 'codesType' => 'currencies', 'incompatibleCodes' => $paypalConfiguration->getIncompatibleCurrencyCodes(), 'paypalLink' => 'https://developer.paypal.com/docs/api/reference/currency-codes/#', - 'paymentPreferencesLink' => $moduleContext->getGeneratedLink($isShop17 ? 'AdminPaymentPreferences' : 'AdminPayment'), + 'paymentPreferencesLink' => $moduleContext->getGeneratedLink('AdminPayment'), ]; $template = 'views/templates/hook/adminAfterHeader/incompatibleCodes.tpl'; } else { @@ -1168,12 +1079,6 @@ public function hookActionFrontControllerSetMedia() */ public function addCheckboxCarrierRestrictionsForModule(array $shopsList = []) { - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - if (false === $shopContext->isShop17()) { - return true; - } - $shopsList = empty($shopsList) ? Shop::getShops(true, null, true) : $shopsList; $carriersList = Carrier::getCarriers((int) Context::getContext()->language->id, false, false, false, null, Carrier::ALL_CARRIERS); $allCarriers = array_column($carriersList, 'id_reference'); @@ -1468,9 +1373,6 @@ public function hookDisplayPaymentTop() return ''; } - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - /** @var \PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository $psCheckoutCartRepository */ $psCheckoutCartRepository = $this->getService(\PrestaShop\Module\PrestashopCheckout\Repository\PsCheckoutCartRepository::class); @@ -1481,9 +1383,7 @@ public function hookDisplayPaymentTop() $this->context->smarty->assign([ 'cancelTranslatedText' => $this->l('Choose another payment method'), - 'is17' => $shopContext->isShop17(), 'isExpressCheckout' => $isExpressCheckout, - 'isOnePageCheckout16' => !$shopContext->isShop17() && (bool) Configuration::get('PS_ORDER_PROCESS_TYPE'), 'spinnerPath' => $this->getPathUri() . 'views/img/tail-spin.svg', 'loaderTranslatedText' => $this->l('Please wait, loading additional payment methods.'), 'paypalLogoPath' => $this->getPathUri() . 'views/img/paypal_express.png', @@ -1562,34 +1462,10 @@ public function hookDisplayPaymentByBinaries(array $params) */ private function getCheckoutPageUrl() { - /** @var \PrestaShop\Module\PrestashopCheckout\ShopContext $shopContext */ - $shopContext = $this->getService(\PrestaShop\Module\PrestashopCheckout\ShopContext::class); - - if ($shopContext->isShop17()) { - return $this->context->link->getPageLink( - 'order', - true, - (int) $this->context->language->id - ); - } - - // PrestaShop 1.6 legacy native one page checkout - if (1 === (int) Configuration::get('PS_ORDER_PROCESS_TYPE')) { - return $this->context->link->getPageLink( - 'order-opc', - true, - (int) $this->context->language->id - ); - } - - // PrestaShop 1.6 standard checkout return $this->context->link->getPageLink( 'order', true, - (int) $this->context->language->id, - [ - 'step' => 1, - ] + (int) $this->context->language->id ); } diff --git a/src/Adapter/LanguageAdapter.php b/src/Adapter/LanguageAdapter.php index 511295939..c563f3abf 100644 --- a/src/Adapter/LanguageAdapter.php +++ b/src/Adapter/LanguageAdapter.php @@ -52,13 +52,7 @@ public function getLanguage($idLang) { $language = \Language::getLanguage($idLang); - if (false === $this->shopContext->isShop17()) { - $locale = explode('-', $language['language_code']); - $locale[1] = strtoupper($locale[1]); - $language['locale'] = implode('_', $locale); - } else { - $language['locale'] = str_replace('-', '_', $language['locale']); - } + $language['locale'] = str_replace('-', '_', $language['locale']); return $language; } diff --git a/src/Adapter/LinkAdapter.php b/src/Adapter/LinkAdapter.php index f95b435d2..9bcefb5fc 100644 --- a/src/Adapter/LinkAdapter.php +++ b/src/Adapter/LinkAdapter.php @@ -58,34 +58,19 @@ public function __construct(\Link $link = null) public function getAdminLink($controller, $withToken = true, $sfRouteParams = [], $params = []) { $shop = \Context::getContext()->shop; - /** @var \Ps_checkout $module */ - $module = \Module::getInstanceByName('ps_checkout'); - /** @var ShopContext $shopContext */ - $shopContext = $module->getService(ShopContext::class); - if ($shopContext->isShop17()) { - $adminLink = $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params); + $adminLink = $this->link->getAdminLink($controller, $withToken, $sfRouteParams, $params); - if ($shop->virtual_uri !== '') { - $adminLink = str_replace($shop->physical_uri . $shop->virtual_uri, $shop->physical_uri, $adminLink); - } - - // We have problems with links in our zoid application, since some links generated don't have domain they redirect to CDN domain - // Routes that use new symfony router are returned without the domain - if (strpos($adminLink, 'http') !== 0) { - return \Tools::getShopDomainSsl(true) . $adminLink; - } - - return $adminLink; + if ($shop->virtual_uri !== '') { + $adminLink = str_replace($shop->physical_uri . $shop->virtual_uri, $shop->physical_uri, $adminLink); } - $paramsAsString = ''; - foreach ($params as $key => $value) { - $paramsAsString .= "&$key=$value"; + // We have problems with links in our zoid application, since some links generated don't have domain they redirect to CDN domain + // Routes that use new symfony router are returned without the domain + if (strpos($adminLink, 'http') !== 0) { + return \Tools::getShopDomainSsl(true) . $adminLink; } - $link = \Tools::getShopDomainSsl(true) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/' . $this->link->getAdminLink($controller, $withToken) . $paramsAsString; - - return $shop->virtual_uri !== '' ? str_replace($shop->physical_uri . $shop->virtual_uri, $shop->physical_uri, $link) : $link; + return $adminLink; } } diff --git a/src/Handler/CreatePaypalOrderHandler.php b/src/Handler/CreatePaypalOrderHandler.php index beb2d808f..31ec71e7d 100644 --- a/src/Handler/CreatePaypalOrderHandler.php +++ b/src/Handler/CreatePaypalOrderHandler.php @@ -79,13 +79,7 @@ public function handle($expressCheckout = false, $isCardPayment = false, $update $builder->setPaypalOrderId($paypalOrderId); } - if ($shopContext->isShop17()) { - // Build full payload in 1.7 - $builder->buildFullPayload(); - } else { - // if on 1.6 always build minimal payload - $builder->buildMinimalPayload(); - } + $builder->buildFullPayload(); $payload = $builder->presentPayload()->getArray(); @@ -102,8 +96,7 @@ public function handle($expressCheckout = false, $isCardPayment = false, $update } catch (PayPalException $exception) { $previousException = $exception->getPrevious(); $response = method_exists($previousException, 'getResponse') ? $previousException->getResponse() : null; - // Retry with minimal payload when full payload failed (only on 1.7) - if ($response && substr((string) $response->getStatusCode(), 0, 1) === '4' && $shopContext->isShop17()) { + if ($response && substr((string) $response->getStatusCode(), 0, 1) === '4') { $builder->buildMinimalPayload(); $payload = $builder->presentPayload()->getArray(); diff --git a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php index 930d13728..87a69558a 100644 --- a/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/CreatePayPalOrderCommandHandler.php @@ -133,13 +133,7 @@ public function handle(CreatePayPalOrderCommand $command) $builder->setSavePaymentMethod($command->vault()); $builder->setVault($command->getPaymentTokenId() || $command->vault()); - if ($this->shopContext->isShop17()) { - // Build full payload in 1.7 - $builder->buildFullPayload(); - } else { - // if on 1.6 always build minimal payload - $builder->buildMinimalPayload(); - } + $builder->buildFullPayload(); $response = $this->maaslandHttpClient->createOrder($builder->presentPayload()->getArray()); $order = json_decode($response->getBody(), true); diff --git a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php index 3e3cfdbd8..8f6381417 100644 --- a/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php +++ b/src/PayPal/Order/CommandHandler/UpdatePayPalOrderCommandHandler.php @@ -97,13 +97,7 @@ public function __invoke(UpdatePayPalOrderCommand $command) $builder->setIsCard($command->getFundingSource() === 'card' && $command->isHostedFields()); $builder->setExpressCheckout($command->isExpressCheckout()); - if ($this->shopContext->isShop17()) { - // Build full payload in 1.7 - $builder->buildFullPayload(); - } else { - // if on 1.6 always build minimal payload - $builder->buildMinimalPayload(); - } + $builder->buildFullPayload(); $payload = $builder->presentPayload()->getArray(); $needToUpdate = false; diff --git a/src/PayPal/Order/PayPalOrderSummaryView.php b/src/PayPal/Order/PayPalOrderSummaryView.php index 02bf762ce..5c4003915 100644 --- a/src/PayPal/Order/PayPalOrderSummaryView.php +++ b/src/PayPal/Order/PayPalOrderSummaryView.php @@ -106,7 +106,6 @@ public function getTemplateVars() 'approvalLink' => $this->orderPayPalDataProvider->getApprovalLink(), 'payerActionLink' => $this->orderPayPalDataProvider->getPayActionLink(), 'contactUsLink' => $this->router->getContactLink($this->orderDataProvider->getOrderId()), - 'isShop17' => $this->shopContext->isShop17(), 'translations' => $this->orderPayPalPresenter->getSummaryTranslations(), 'vault' => $this->orderPayPalDataProvider->isIntentToVault(), 'tokenIdentifier' => $this->orderPayPalDataProvider->getPaymentTokenIdentifier(), diff --git a/src/Presenter/Store/Modules/ContextModule.php b/src/Presenter/Store/Modules/ContextModule.php index 140b35cb4..6abcabf37 100644 --- a/src/Presenter/Store/Modules/ContextModule.php +++ b/src/Presenter/Store/Modules/ContextModule.php @@ -149,7 +149,6 @@ public function present() 'moduleIsEnabled' => $this->moduleManager->isEnabled('ps_checkout'), 'psVersion' => _PS_VERSION_, 'phpVersion' => phpversion(), - 'shopIs17' => $this->shopContext->isShop17(), 'moduleKey' => $this->moduleKey, 'shopId' => $this->psAccountRepository->getShopUuid(), 'shopUri' => $this->shopProvider->getShopUrl($shopId), @@ -173,7 +172,7 @@ public function present() 'incompatibleCurrencyCodes' => $this->paypalConfiguration->getIncompatibleCurrencyCodes(), 'countriesLink' => $this->getGeneratedLink('AdminCountries'), 'currenciesLink' => $this->getGeneratedLink('AdminCurrencies'), - 'paymentPreferencesLink' => $this->getGeneratedLink($this->shopContext->isShop17() ? 'AdminPaymentPreferences' : 'AdminPayment'), + 'paymentPreferencesLink' => $this->getGeneratedLink('AdminPaymentPreferences'), 'maintenanceLink' => $this->getGeneratedLink('AdminMaintenance'), 'overridesExist' => $this->overridesExist(), 'submitIdeaLink' => $this->getSubmitIdeaLink(), diff --git a/src/ShopContext.php b/src/ShopContext.php index a538d30bc..580db2ccf 100644 --- a/src/ShopContext.php +++ b/src/ShopContext.php @@ -61,14 +61,4 @@ public function getBnCode() return $this->env->getBnCode(); } - - public function isShop17() - { - return version_compare(_PS_VERSION_, '1.7.0.0', '>='); - } - - public function isShop171() - { - return version_compare(_PS_VERSION_, '1.7.1.0', '>='); - } } diff --git a/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl b/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl index 26a7df5c7..5bacf186a 100644 --- a/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl +++ b/views/templates/hook/adminAfterHeader/incompatibleCodes.tpl @@ -19,14 +19,10 @@ {if $incompatibleCodes}
- {if $isShop17} -