From 847eca8746a0993769d5e6dcdcc1addd2cce500d Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 11:33:41 +0200 Subject: [PATCH 01/44] Add Symfony 7.0 to reqs and CI, drop 6.2 from CI --- .github/workflows/ci.yml | 24 ++++++++++++++++-------- composer.json | 24 ++++++++++++------------ pkg/async-command/composer.json | 16 ++++++++-------- pkg/async-event-dispatcher/composer.json | 14 +++++++------- pkg/enqueue-bundle/composer.json | 10 +++++----- pkg/enqueue/composer.json | 18 +++++++++--------- pkg/fs/composer.json | 6 +++--- pkg/job-queue/composer.json | 8 ++++---- pkg/simple-client/composer.json | 4 ++-- 9 files changed, 66 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c29d8430c..156f0a356 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,17 +78,21 @@ jobs: fail-fast: false matrix: php: ['7.4', '8.0', '8.1', '8.2'] - symfony_version: ['5.4.*', '6.2.*', '6.3.*'] + symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - php: '7.4' - symfony_version: '6.2.*' + symfony_version: '6.3.*' + - php: '7.4' + symfony_version: '6.4.*' - php: '7.4' + symfony_version: '7.0.*' + - php: '8.0' symfony_version: '6.3.*' - php: '8.0' - symfony_version: '6.2.*' + symfony_version: '6.4.*' - php: '8.0' - symfony_version: '6.3.*' + symfony_version: '7.0.*' name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} @@ -128,17 +132,21 @@ jobs: fail-fast: false matrix: php: ['7.4', '8.0', '8.1', '8.2'] # same as in the container - symfony_version: ['5.4.*', '6.2.*', '6.3.*'] + symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - php: '7.4' - symfony_version: '6.2.*' + symfony_version: '6.3.*' + - php: '7.4' + symfony_version: '6.4.*' - php: '7.4' + symfony_version: '7.0.*' + - php: '8.0' symfony_version: '6.3.*' - php: '8.0' - symfony_version: '6.2.*' + symfony_version: '6.4.*' - php: '8.0' - symfony_version: '6.3.*' + symfony_version: '7.0.*' name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} diff --git a/composer.json b/composer.json index 5c0108e27..558d60603 100644 --- a/composer.json +++ b/composer.json @@ -53,18 +53,18 @@ "phpunit/phpunit": "^9.5", "phpstan/phpstan": "^0.12", "queue-interop/queue-spec": "^0.6.2", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/framework-bundle": "^5.4|^6.0", - "symfony/validator": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/console": "^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/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/validator": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "empi89/php-amqp-stubs": "*@dev", "doctrine/doctrine-bundle": "^2.3.2", "doctrine/mongodb-odm-bundle": "^3.5|^4.3", diff --git a/pkg/async-command/composer.json b/pkg/async-command/composer.json index 48fd6f089..c66b5fb09 100644 --- a/pkg/async-command/composer.json +++ b/pkg/async-command/composer.json @@ -9,16 +9,16 @@ "php": "^7.4|^8.0", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^9.5", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "enqueue/null": "0.10.x-dev", "enqueue/fs": "0.10.x-dev", "enqueue/test": "0.10.x-dev" @@ -31,7 +31,7 @@ "docs": "https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md" }, "suggest": { - "symfony/dependency-injection": "^5.4|^6.0 If you'd like to use async event dispatcher container extension." + "symfony/dependency-injection": "^5.4|^6.0|^7.0 If you'd like to use async event dispatcher container extension." }, "autoload": { "psr-4": { "Enqueue\\AsyncCommand\\": "" }, diff --git a/pkg/async-event-dispatcher/composer.json b/pkg/async-event-dispatcher/composer.json index a2cef0d79..693169c77 100644 --- a/pkg/async-event-dispatcher/composer.json +++ b/pkg/async-event-dispatcher/composer.json @@ -9,15 +9,15 @@ "php": "^7.4|^8.0", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", - "symfony/event-dispatcher": "^5.4|^6.0" + "symfony/event-dispatcher": "^5.4|^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^9.5", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "enqueue/null": "0.10.x-dev", "enqueue/fs": "0.10.x-dev", "enqueue/test": "0.10.x-dev" @@ -30,7 +30,7 @@ "docs": "https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md" }, "suggest": { - "symfony/dependency-injection": "^5.4|^6.0 If you'd like to use async event dispatcher container extension." + "symfony/dependency-injection": "^5.4|^6.0|^7.0 If you'd like to use async event dispatcher container extension." }, "autoload": { "psr-4": { "Enqueue\\AsyncEventDispatcher\\": "" }, diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index 7ee50c269..42563e545 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -7,7 +7,7 @@ "license": "MIT", "require": { "php": "^7.4|^8.0", - "symfony/framework-bundle": "^5.4|^6.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "enqueue/enqueue": "^0.10", @@ -39,10 +39,10 @@ "doctrine/doctrine-bundle": "^2.3.2", "doctrine/mongodb-odm-bundle": "^3.5|^4.3", "alcaeus/mongo-php-adapter": "^1.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/validator": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/validator": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "suggest": { "enqueue/async-command": "If want to run Symfony command via message queue", diff --git a/pkg/enqueue/composer.json b/pkg/enqueue/composer.json index 0da00ee4b..b68606c8f 100644 --- a/pkg/enqueue/composer.json +++ b/pkg/enqueue/composer.json @@ -17,12 +17,12 @@ }, "require-dev": { "phpunit/phpunit": "^9.5", - "symfony/console": "^5.41|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0", + "symfony/console": "^5.41|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0", "enqueue/amqp-ext": "0.10.x-dev", "enqueue/amqp-lib": "0.10.x-dev", "enqueue/amqp-bunny": "0.10.x-dev", @@ -42,9 +42,9 @@ "enqueue/dsn": "0.10.x-dev" }, "suggest": { - "symfony/console": "^5.4|^6.0 If you want to use cli commands", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0|^7.0 If you want to use cli commands", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", "enqueue/amqp-ext": "AMQP transport (based on php extension)", "enqueue/stomp": "STOMP transport", "enqueue/fs": "Filesystem transport", diff --git a/pkg/fs/composer.json b/pkg/fs/composer.json index b44900541..e47bd950f 100644 --- a/pkg/fs/composer.json +++ b/pkg/fs/composer.json @@ -9,7 +9,7 @@ "php": "^7.4|^8.0", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", - "symfony/filesystem": "^5.4|^6.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", "makasim/temp-file": "^0.2@stable" }, "require-dev": { @@ -17,8 +17,8 @@ "enqueue/null": "0.10.x-dev", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "support": { "email": "opensource@forma-pro.com", diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index 55d37d5da..ff5b6ed81 100644 --- a/pkg/job-queue/composer.json +++ b/pkg/job-queue/composer.json @@ -17,10 +17,10 @@ "phpunit/phpunit": "^9.5", "enqueue/test": "0.10.x-dev", "doctrine/doctrine-bundle": "^2.3.2", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/framework-bundle": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "symfony/browser-kit": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "support": { "email": "opensource@forma-pro.com", diff --git a/pkg/simple-client/composer.json b/pkg/simple-client/composer.json index 7cb07b6b3..84e3b73a7 100644 --- a/pkg/simple-client/composer.json +++ b/pkg/simple-client/composer.json @@ -10,7 +10,7 @@ "enqueue/enqueue": "^0.10", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", - "symfony/config": "^5.4|^6.0" + "symfony/config": "^5.4|^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^9.5", @@ -18,7 +18,7 @@ "enqueue/amqp-ext": "0.10.x-dev", "enqueue/fs": "0.10.x-dev", "enqueue/null": "0.10.x-dev", - "symfony/yaml": "^5.4|^6.0" + "symfony/yaml": "^5.4|^6.0|^7.0" }, "support": { "email": "opensource@forma-pro.com", From 6814e1dab96d37bcc429813bf50337a90b8379b4 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 11:53:43 +0200 Subject: [PATCH 02/44] =?UTF-8?q?Cast=20to=20int=20to=20avoid=20type=20err?= =?UTF-8?q?ors=20=E2=80=94=20probably=20the=20new=20extension=20forces=20i?= =?UTF-8?q?t=20now=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/amqp-ext/AmqpContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/amqp-ext/AmqpContext.php b/pkg/amqp-ext/AmqpContext.php index 5ea099da2..6a7012edf 100644 --- a/pkg/amqp-ext/AmqpContext.php +++ b/pkg/amqp-ext/AmqpContext.php @@ -278,7 +278,7 @@ public function convertMessage(\AMQPEnvelope $extEnvelope): InteropAmqpMessage ] ); $message->setRedelivered($extEnvelope->isRedelivery()); - $message->setDeliveryTag($extEnvelope->getDeliveryTag()); + $message->setDeliveryTag((int) $extEnvelope->getDeliveryTag()); $message->setRoutingKey($extEnvelope->getRoutingKey()); return $message; From 9d4b80d0eab6f3d0f09aad458e9c417306c1438f Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 11:54:43 +0200 Subject: [PATCH 03/44] Skip PHP 8.1 on Symfony 7.0 in the CI matrix --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 156f0a356..2d11cff0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,6 +93,8 @@ jobs: symfony_version: '6.4.*' - php: '8.0' symfony_version: '7.0.*' + - php: '8.1' + symfony_version: '7.0.*' name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} @@ -147,6 +149,8 @@ jobs: symfony_version: '6.4.*' - php: '8.0' symfony_version: '7.0.*' + - php: '8.1' + symfony_version: '7.0.*' name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} From f0a0ae7aa25c35aedb34838d2bafb69b1f188364 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 11:58:36 +0200 Subject: [PATCH 04/44] Fix CS --- pkg/amqp-ext/AmqpContext.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/amqp-ext/AmqpContext.php b/pkg/amqp-ext/AmqpContext.php index 6a7012edf..f13a7a569 100644 --- a/pkg/amqp-ext/AmqpContext.php +++ b/pkg/amqp-ext/AmqpContext.php @@ -177,7 +177,7 @@ public function unbind(InteropAmqpBind $bind): void public function createTemporaryQueue(): Queue { $extQueue = new \AMQPQueue($this->getExtChannel()); - $extQueue->setFlags(AMQP_EXCLUSIVE); + $extQueue->setFlags(\AMQP_EXCLUSIVE); $extQueue->declareQueue(); @@ -243,10 +243,7 @@ public function getExtChannel(): \AMQPChannel if (false == $this->extChannel) { $extChannel = call_user_func($this->extChannelFactory); if (false == $extChannel instanceof \AMQPChannel) { - throw new \LogicException(sprintf( - 'The factory must return instance of AMQPChannel. It returns %s', - is_object($extChannel) ? get_class($extChannel) : gettype($extChannel) - )); + throw new \LogicException(sprintf('The factory must return instance of AMQPChannel. It returns %s', is_object($extChannel) ? get_class($extChannel) : gettype($extChannel))); } $this->extChannel = $extChannel; From 90b6b56b9c4fd09b82469c410e2dc7a79bd789f4 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:08:29 +0200 Subject: [PATCH 05/44] Try with doctrine/mongodb-odm-bundle:5.0.x-dev --- composer.json | 2 +- pkg/enqueue-bundle/composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 558d60603..6a7deca78 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,7 @@ "symfony/yaml": "^5.4|^6.0|^7.0", "empi89/php-amqp-stubs": "*@dev", "doctrine/doctrine-bundle": "^2.3.2", - "doctrine/mongodb-odm-bundle": "^3.5|^4.3", + "doctrine/mongodb-odm-bundle": "^3.5|^4.3|5.0.x-dev", "alcaeus/mongo-php-adapter": "^1.0", "kwn/php-rdkafka-stubs": "^2.0.3", "friendsofphp/php-cs-fixer": "^3.4", diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index 42563e545..b8cb90e26 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -37,7 +37,7 @@ "enqueue/async-command": "0.10.x-dev", "php-amqplib/php-amqplib": "^3.0", "doctrine/doctrine-bundle": "^2.3.2", - "doctrine/mongodb-odm-bundle": "^3.5|^4.3", + "doctrine/mongodb-odm-bundle": "^3.5|^4.3|5.0.x-dev", "alcaeus/mongo-php-adapter": "^1.0", "symfony/browser-kit": "^5.4|^6.0|^7.0", "symfony/expression-language": "^5.4|^6.0|^7.0", From 48d4fea21306e9bd7d4515ea519a3a09fd1b6416 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:11:14 +0200 Subject: [PATCH 06/44] Fix ext-mongo override --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6a7deca78..9d679136c 100644 --- a/composer.json +++ b/composer.json @@ -125,7 +125,7 @@ "ext-amqp": "1.9.3", "ext-gearman": "2.0.3", "ext-rdkafka": "4.0", - "ext-mongodb": "1.5", + "ext-mongodb": "1.17", "ext-bcmath": "1", "ext-mbstring": "1", "ext-mongo": "1.6.14", From b5ef96e31c1302c1169473f1c91a31233d7960e0 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:24:44 +0200 Subject: [PATCH 07/44] Remove usage of deprecated ContainerAware --- .../ContainerAwareRegistry.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/async-event-dispatcher/ContainerAwareRegistry.php b/pkg/async-event-dispatcher/ContainerAwareRegistry.php index 2763ed72b..ce80fff8d 100644 --- a/pkg/async-event-dispatcher/ContainerAwareRegistry.php +++ b/pkg/async-event-dispatcher/ContainerAwareRegistry.php @@ -2,13 +2,10 @@ namespace Enqueue\AsyncEventDispatcher; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Symfony\Component\DependencyInjection\ContainerInterface; -class ContainerAwareRegistry implements Registry, ContainerAwareInterface +class ContainerAwareRegistry implements Registry { - use ContainerAwareTrait; - /** * @var string[] */ @@ -19,6 +16,8 @@ class ContainerAwareRegistry implements Registry, ContainerAwareInterface */ private $transformersMap; + private ContainerInterface $container; + /** * @param string[] $eventsMap [eventName => transformerName] * @param string[] $transformersMap [transformerName => transformerServiceId] @@ -29,6 +28,11 @@ public function __construct(array $eventsMap, array $transformersMap) $this->transformersMap = $transformersMap; } + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + /** * {@inheritdoc} */ From fd6a9b6ac5e2f5aaa966c63379e90f283878578f Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:30:00 +0200 Subject: [PATCH 08/44] Fix CS --- pkg/async-event-dispatcher/ContainerAwareRegistry.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/async-event-dispatcher/ContainerAwareRegistry.php b/pkg/async-event-dispatcher/ContainerAwareRegistry.php index ce80fff8d..6197febc1 100644 --- a/pkg/async-event-dispatcher/ContainerAwareRegistry.php +++ b/pkg/async-event-dispatcher/ContainerAwareRegistry.php @@ -33,9 +33,6 @@ public function setContainer(ContainerInterface $container = null) $this->container = $container; } - /** - * {@inheritdoc} - */ public function getTransformerNameForEvent($eventName) { $transformerName = null; @@ -62,9 +59,6 @@ public function getTransformerNameForEvent($eventName) return $transformerName; } - /** - * {@inheritdoc} - */ public function getTransformer($name) { if (false == array_key_exists($name, $this->transformersMap)) { From e99fac7a9db3232c76d7e99af2b7165a11b965b4 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:34:16 +0200 Subject: [PATCH 09/44] Fix config type error? --- .../Symfony/Client/DependencyInjection/ClientFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php b/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php index 2eede31b7..4e8fefd71 100644 --- a/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php +++ b/pkg/enqueue/Symfony/Client/DependencyInjection/ClientFactory.php @@ -79,7 +79,7 @@ public static function getConfiguration(bool $debug, string $name = 'client'): N ->info('The array contains driver specific options') ->ignoreExtraKeys(false) ->end() - ->end()->end() + ->end() ; return $builder; From e9bad64f5e144754f2f7f9930cd5f98d3bf3915b Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:41:55 +0200 Subject: [PATCH 10/44] Fix CS --- pkg/async-event-dispatcher/ContainerAwareRegistry.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/async-event-dispatcher/ContainerAwareRegistry.php b/pkg/async-event-dispatcher/ContainerAwareRegistry.php index 6197febc1..60dfff28a 100644 --- a/pkg/async-event-dispatcher/ContainerAwareRegistry.php +++ b/pkg/async-event-dispatcher/ContainerAwareRegistry.php @@ -68,11 +68,7 @@ public function getTransformer($name) $transformer = $this->container->get($this->transformersMap[$name]); if (false == $transformer instanceof EventTransformer) { - throw new \LogicException(sprintf( - 'The container must return instance of %s but got %s', - EventTransformer::class, - is_object($transformer) ? get_class($transformer) : gettype($transformer) - )); + throw new \LogicException(sprintf('The container must return instance of %s but got %s', EventTransformer::class, is_object($transformer) ? get_class($transformer) : gettype($transformer))); } return $transformer; From e910537008c40fde8daf013b8501f8f9c1314219 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 12:46:53 +0200 Subject: [PATCH 11/44] Fix doctrine/annotations:2 compatibility --- pkg/job-queue/Tests/Functional/app/AppKernel.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/job-queue/Tests/Functional/app/AppKernel.php b/pkg/job-queue/Tests/Functional/app/AppKernel.php index 3cef602c2..61793010f 100644 --- a/pkg/job-queue/Tests/Functional/app/AppKernel.php +++ b/pkg/job-queue/Tests/Functional/app/AppKernel.php @@ -1,6 +1,9 @@ Date: Thu, 21 Dec 2023 12:50:43 +0200 Subject: [PATCH 12/44] =?UTF-8?q?Fix=20CS=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/async-event-dispatcher/ContainerAwareRegistry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/async-event-dispatcher/ContainerAwareRegistry.php b/pkg/async-event-dispatcher/ContainerAwareRegistry.php index 60dfff28a..1a895f486 100644 --- a/pkg/async-event-dispatcher/ContainerAwareRegistry.php +++ b/pkg/async-event-dispatcher/ContainerAwareRegistry.php @@ -67,7 +67,7 @@ public function getTransformer($name) $transformer = $this->container->get($this->transformersMap[$name]); - if (false == $transformer instanceof EventTransformer) { + if (false == $transformer instanceof EventTransformer) { throw new \LogicException(sprintf('The container must return instance of %s but got %s', EventTransformer::class, is_object($transformer) ? get_class($transformer) : gettype($transformer))); } From eda3d7d9d0f0dcd83bf992a2862545bc830579bd Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 13:05:21 +0200 Subject: [PATCH 13/44] =?UTF-8?q?Drop=20PHP=207.4=20=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 18 +++--------------- composer.json | 2 +- docker-compose.yml | 4 ++-- docker/thruway/Dockerfile | 2 +- pkg/amqp-bunny/.github/workflows/ci.yml | 2 +- pkg/amqp-bunny/composer.json | 2 +- pkg/amqp-ext/.github/workflows/ci.yml | 2 +- pkg/amqp-ext/composer.json | 2 +- pkg/amqp-lib/.github/workflows/ci.yml | 2 +- pkg/amqp-lib/composer.json | 2 +- pkg/amqp-tools/.github/workflows/ci.yml | 2 +- pkg/amqp-tools/composer.json | 2 +- pkg/async-command/.github/workflows/ci.yml | 2 +- pkg/async-command/composer.json | 2 +- .../.github/workflows/ci.yml | 2 +- pkg/async-event-dispatcher/composer.json | 2 +- pkg/dbal/.github/workflows/ci.yml | 2 +- pkg/dbal/composer.json | 2 +- pkg/dsn/.github/workflows/ci.yml | 2 +- pkg/dsn/composer.json | 2 +- pkg/enqueue-bundle/.github/workflows/ci.yml | 2 +- pkg/enqueue-bundle/composer.json | 2 +- pkg/enqueue/.github/workflows/ci.yml | 2 +- pkg/enqueue/composer.json | 2 +- pkg/fs/.github/workflows/ci.yml | 2 +- pkg/fs/composer.json | 2 +- pkg/gearman/.github/workflows/ci.yml | 2 +- pkg/gearman/composer.json | 2 +- pkg/gps/.github/workflows/ci.yml | 2 +- pkg/gps/composer.json | 2 +- pkg/job-queue/.github/workflows/ci.yml | 2 +- pkg/job-queue/composer.json | 2 +- pkg/mongodb/.github/workflows/ci.yml | 2 +- pkg/mongodb/composer.json | 2 +- pkg/monitoring/.github/workflows/ci.yml | 2 +- pkg/monitoring/composer.json | 2 +- pkg/null/.github/workflows/ci.yml | 2 +- pkg/null/composer.json | 2 +- pkg/pheanstalk/.github/workflows/ci.yml | 2 +- pkg/pheanstalk/composer.json | 2 +- pkg/rdkafka/.github/workflows/ci.yml | 2 +- pkg/rdkafka/composer.json | 2 +- pkg/redis/.github/workflows/ci.yml | 2 +- pkg/redis/composer.json | 2 +- pkg/simple-client/.github/workflows/ci.yml | 2 +- pkg/simple-client/composer.json | 2 +- pkg/sns/.github/workflows/ci.yml | 2 +- pkg/sns/composer.json | 2 +- pkg/snsqs/.github/workflows/ci.yml | 2 +- pkg/snsqs/composer.json | 2 +- pkg/sqs/.github/workflows/ci.yml | 2 +- pkg/sqs/composer.json | 2 +- pkg/stomp/.github/workflows/ci.yml | 2 +- pkg/stomp/composer.json | 2 +- pkg/wamp/.github/workflows/ci.yml | 2 +- pkg/wamp/composer.json | 2 +- 56 files changed, 59 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d11cff0f..f05ccc2e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: '8.0' coverage: none extensions: mongodb, redis, :xdebug ini-values: memory_limit=2048M @@ -77,16 +77,10 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - - php: '7.4' - symfony_version: '6.3.*' - - php: '7.4' - symfony_version: '6.4.*' - - php: '7.4' - symfony_version: '7.0.*' - php: '8.0' symfony_version: '6.3.*' - php: '8.0' @@ -133,16 +127,10 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] # same as in the container + php: ['8.0', '8.1', '8.2'] # same as in the container symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - - php: '7.4' - symfony_version: '6.3.*' - - php: '7.4' - symfony_version: '6.4.*' - - php: '7.4' - symfony_version: '7.0.*' - php: '8.0' symfony_version: '6.3.*' - php: '8.0' diff --git a/composer.json b/composer.json index 9d679136c..936cf9af1 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "phpstan": "bin/phpstan analyse --memory-limit=512M -c phpstan.neon" }, "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "ext-amqp": "^1.9.3|^2.0.0", "ext-gearman": "^2.0", diff --git a/docker-compose.yml b/docker-compose.yml index c5fa5545b..754356904 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,11 +3,11 @@ version: '2' services: dev: # when image publishing gets sorted: -# image: enqueue/dev:${PHP_VERSION:-7.4} +# image: enqueue/dev:${PHP_VERSION:-8.0} build: context: docker args: - PHP_VERSION: "${PHP_VERSION:-7.4}" + PHP_VERSION: "${PHP_VERSION:-8.0}" depends_on: - rabbitmq - mysql diff --git a/docker/thruway/Dockerfile b/docker/thruway/Dockerfile index 042a49d64..8cc98a4bf 100644 --- a/docker/thruway/Dockerfile +++ b/docker/thruway/Dockerfile @@ -1,4 +1,4 @@ -FROM makasim/nginx-php-fpm:7.4-all-exts +FROM makasim/nginx-php-fpm:8.0-all-exts RUN mkdir -p /thruway WORKDIR /thruway diff --git a/pkg/amqp-bunny/.github/workflows/ci.yml b/pkg/amqp-bunny/.github/workflows/ci.yml index 5448d7b1a..7218b3b23 100644 --- a/pkg/amqp-bunny/.github/workflows/ci.yml +++ b/pkg/amqp-bunny/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-bunny/composer.json b/pkg/amqp-bunny/composer.json index 5bffcebd8..b17794aba 100644 --- a/pkg/amqp-bunny/composer.json +++ b/pkg/amqp-bunny/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "bunny/bunny": "^0.4|^0.5", diff --git a/pkg/amqp-ext/.github/workflows/ci.yml b/pkg/amqp-ext/.github/workflows/ci.yml index d48deb0af..69f428c7a 100644 --- a/pkg/amqp-ext/.github/workflows/ci.yml +++ b/pkg/amqp-ext/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-ext/composer.json b/pkg/amqp-ext/composer.json index b81363bb9..bf8840016 100644 --- a/pkg/amqp-ext/composer.json +++ b/pkg/amqp-ext/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "ext-amqp": "^1.9.3|^2.0.0", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/amqp-lib/.github/workflows/ci.yml b/pkg/amqp-lib/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/amqp-lib/.github/workflows/ci.yml +++ b/pkg/amqp-lib/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-lib/composer.json b/pkg/amqp-lib/composer.json index dfb73a311..72645cc63 100644 --- a/pkg/amqp-lib/composer.json +++ b/pkg/amqp-lib/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "php-amqplib/php-amqplib": "^3.2", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/amqp-tools/.github/workflows/ci.yml b/pkg/amqp-tools/.github/workflows/ci.yml index 5448d7b1a..7218b3b23 100644 --- a/pkg/amqp-tools/.github/workflows/ci.yml +++ b/pkg/amqp-tools/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-tools/composer.json b/pkg/amqp-tools/composer.json index 55f82f5d7..2fdce7d08 100644 --- a/pkg/amqp-tools/composer.json +++ b/pkg/amqp-tools/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10" diff --git a/pkg/async-command/.github/workflows/ci.yml b/pkg/async-command/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/async-command/.github/workflows/ci.yml +++ b/pkg/async-command/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/async-command/composer.json b/pkg/async-command/composer.json index c66b5fb09..0956d9d18 100644 --- a/pkg/async-command/composer.json +++ b/pkg/async-command/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", "symfony/console": "^5.4|^6.0|^7.0", diff --git a/pkg/async-event-dispatcher/.github/workflows/ci.yml b/pkg/async-event-dispatcher/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/async-event-dispatcher/.github/workflows/ci.yml +++ b/pkg/async-event-dispatcher/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/async-event-dispatcher/composer.json b/pkg/async-event-dispatcher/composer.json index 693169c77..630a4b2f0 100644 --- a/pkg/async-event-dispatcher/composer.json +++ b/pkg/async-event-dispatcher/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", "symfony/event-dispatcher": "^5.4|^6.0|^7.0" diff --git a/pkg/dbal/.github/workflows/ci.yml b/pkg/dbal/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/dbal/.github/workflows/ci.yml +++ b/pkg/dbal/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/dbal/composer.json b/pkg/dbal/composer.json index a4d4af7f4..f36790e03 100644 --- a/pkg/dbal/composer.json +++ b/pkg/dbal/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "doctrine/dbal": "^2.12|^3.1", "doctrine/persistence": "^2.0|^3.0", diff --git a/pkg/dsn/.github/workflows/ci.yml b/pkg/dsn/.github/workflows/ci.yml index 71bcbbd61..c4ac94e9f 100644 --- a/pkg/dsn/.github/workflows/ci.yml +++ b/pkg/dsn/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/dsn/composer.json b/pkg/dsn/composer.json index 94fb18a9f..dbd39aed7 100644 --- a/pkg/dsn/composer.json +++ b/pkg/dsn/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0" + "php": "^8.0" }, "require-dev": { "phpunit/phpunit": "^9.5" diff --git a/pkg/enqueue-bundle/.github/workflows/ci.yml b/pkg/enqueue-bundle/.github/workflows/ci.yml index 4c397bef1..da6d006c1 100644 --- a/pkg/enqueue-bundle/.github/workflows/ci.yml +++ b/pkg/enqueue-bundle/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index b8cb90e26..1ac1c94c8 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "symfony/framework-bundle": "^5.4|^6.0|^7.0", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/enqueue/.github/workflows/ci.yml b/pkg/enqueue/.github/workflows/ci.yml index 28a46e908..9e85d5004 100644 --- a/pkg/enqueue/.github/workflows/ci.yml +++ b/pkg/enqueue/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/enqueue/composer.json b/pkg/enqueue/composer.json index b68606c8f..c71b0554a 100644 --- a/pkg/enqueue/composer.json +++ b/pkg/enqueue/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "enqueue/null": "^0.10", diff --git a/pkg/fs/.github/workflows/ci.yml b/pkg/fs/.github/workflows/ci.yml index 65cfbbb2d..4e754688d 100644 --- a/pkg/fs/.github/workflows/ci.yml +++ b/pkg/fs/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/fs/composer.json b/pkg/fs/composer.json index e47bd950f..42e807170 100644 --- a/pkg/fs/composer.json +++ b/pkg/fs/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "symfony/filesystem": "^5.4|^6.0|^7.0", diff --git a/pkg/gearman/.github/workflows/ci.yml b/pkg/gearman/.github/workflows/ci.yml index 28ae81b0f..1b3bb032b 100644 --- a/pkg/gearman/.github/workflows/ci.yml +++ b/pkg/gearman/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/gearman/composer.json b/pkg/gearman/composer.json index eb06f62e3..70194a1e4 100644 --- a/pkg/gearman/composer.json +++ b/pkg/gearman/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "ext-gearman": "^2.0", "queue-interop/queue-interop": "^0.8" }, diff --git a/pkg/gps/.github/workflows/ci.yml b/pkg/gps/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/gps/.github/workflows/ci.yml +++ b/pkg/gps/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/gps/composer.json b/pkg/gps/composer.json index 2da6b7468..c8190eebb 100644 --- a/pkg/gps/composer.json +++ b/pkg/gps/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "google/cloud-pubsub": "^1.4.3", "enqueue/dsn": "^0.10" diff --git a/pkg/job-queue/.github/workflows/ci.yml b/pkg/job-queue/.github/workflows/ci.yml index 28a9a9c02..03b088ebe 100644 --- a/pkg/job-queue/.github/workflows/ci.yml +++ b/pkg/job-queue/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index ff5b6ed81..8eaf93f37 100644 --- a/pkg/job-queue/composer.json +++ b/pkg/job-queue/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "enqueue/enqueue": "^0.10", "enqueue/null": "^0.10", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/mongodb/.github/workflows/ci.yml b/pkg/mongodb/.github/workflows/ci.yml index 415baf634..8feb0e9eb 100644 --- a/pkg/mongodb/.github/workflows/ci.yml +++ b/pkg/mongodb/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/mongodb/composer.json b/pkg/mongodb/composer.json index 775452949..fece9c6eb 100644 --- a/pkg/mongodb/composer.json +++ b/pkg/mongodb/composer.json @@ -10,7 +10,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "mongodb/mongodb": "^1.2", "ext-mongodb": "^1.5" diff --git a/pkg/monitoring/.github/workflows/ci.yml b/pkg/monitoring/.github/workflows/ci.yml index 5448d7b1a..7218b3b23 100644 --- a/pkg/monitoring/.github/workflows/ci.yml +++ b/pkg/monitoring/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/monitoring/composer.json b/pkg/monitoring/composer.json index e19da2fa9..78c6d6977 100644 --- a/pkg/monitoring/composer.json +++ b/pkg/monitoring/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "enqueue/enqueue": "^0.10", "enqueue/dsn": "^0.10" }, diff --git a/pkg/null/.github/workflows/ci.yml b/pkg/null/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/null/.github/workflows/ci.yml +++ b/pkg/null/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/null/composer.json b/pkg/null/composer.json index 0f4ac4eeb..108b26510 100644 --- a/pkg/null/composer.json +++ b/pkg/null/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8" }, "require-dev": { diff --git a/pkg/pheanstalk/.github/workflows/ci.yml b/pkg/pheanstalk/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/pheanstalk/.github/workflows/ci.yml +++ b/pkg/pheanstalk/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/pheanstalk/composer.json b/pkg/pheanstalk/composer.json index 8d920a4ff..563aff876 100644 --- a/pkg/pheanstalk/composer.json +++ b/pkg/pheanstalk/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "pda/pheanstalk": "^3.1", "queue-interop/queue-interop": "^0.8" }, diff --git a/pkg/rdkafka/.github/workflows/ci.yml b/pkg/rdkafka/.github/workflows/ci.yml index 9e0ceb121..8056d03ba 100644 --- a/pkg/rdkafka/.github/workflows/ci.yml +++ b/pkg/rdkafka/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/rdkafka/composer.json b/pkg/rdkafka/composer.json index 068b9d204..b3c45ea5e 100644 --- a/pkg/rdkafka/composer.json +++ b/pkg/rdkafka/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "ext-rdkafka": "^4.0|^5.0|^6.0", "queue-interop/queue-interop": "^0.8.1" }, diff --git a/pkg/redis/.github/workflows/ci.yml b/pkg/redis/.github/workflows/ci.yml index 57d501bee..13d289db0 100644 --- a/pkg/redis/.github/workflows/ci.yml +++ b/pkg/redis/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/redis/composer.json b/pkg/redis/composer.json index 4742b3385..1a407dc87 100644 --- a/pkg/redis/composer.json +++ b/pkg/redis/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "ramsey/uuid": "^3.5|^4" diff --git a/pkg/simple-client/.github/workflows/ci.yml b/pkg/simple-client/.github/workflows/ci.yml index 6b24b0f30..14eacfd6b 100644 --- a/pkg/simple-client/.github/workflows/ci.yml +++ b/pkg/simple-client/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/simple-client/composer.json b/pkg/simple-client/composer.json index 84e3b73a7..1ed3554a6 100644 --- a/pkg/simple-client/composer.json +++ b/pkg/simple-client/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "enqueue/enqueue": "^0.10", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/sns/.github/workflows/ci.yml b/pkg/sns/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/sns/.github/workflows/ci.yml +++ b/pkg/sns/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/sns/composer.json b/pkg/sns/composer.json index 297fac858..b406b6737 100644 --- a/pkg/sns/composer.json +++ b/pkg/sns/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "aws/aws-sdk-php": "~3.155" diff --git a/pkg/snsqs/.github/workflows/ci.yml b/pkg/snsqs/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/snsqs/.github/workflows/ci.yml +++ b/pkg/snsqs/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/snsqs/composer.json b/pkg/snsqs/composer.json index 27a4e038e..f9d3c286e 100644 --- a/pkg/snsqs/composer.json +++ b/pkg/snsqs/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "enqueue/sns": "^0.10", diff --git a/pkg/sqs/.github/workflows/ci.yml b/pkg/sqs/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/sqs/.github/workflows/ci.yml +++ b/pkg/sqs/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/sqs/composer.json b/pkg/sqs/composer.json index d48b89015..ac63dcb1d 100644 --- a/pkg/sqs/composer.json +++ b/pkg/sqs/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "aws/aws-sdk-php": "~3.155" diff --git a/pkg/stomp/.github/workflows/ci.yml b/pkg/stomp/.github/workflows/ci.yml index 0492424e8..38112779e 100644 --- a/pkg/stomp/.github/workflows/ci.yml +++ b/pkg/stomp/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/stomp/composer.json b/pkg/stomp/composer.json index 461205852..f2509ebfb 100644 --- a/pkg/stomp/composer.json +++ b/pkg/stomp/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "enqueue/dsn": "^0.10", "stomp-php/stomp-php": "^4.5|^5.0", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/wamp/.github/workflows/ci.yml b/pkg/wamp/.github/workflows/ci.yml index 5448d7b1a..7218b3b23 100644 --- a/pkg/wamp/.github/workflows/ci.yml +++ b/pkg/wamp/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/wamp/composer.json b/pkg/wamp/composer.json index be0321c6f..1f32ad3ae 100644 --- a/pkg/wamp/composer.json +++ b/pkg/wamp/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0", + "php": "^8.0", "queue-interop/queue-interop": "^0.8.1", "enqueue/dsn": "^0.10.8", "thruway/client": "^0.5.5", From dd3168cd86b031f120d228e055f85c6a6bdd4edb Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 21 Dec 2023 13:07:45 +0200 Subject: [PATCH 14/44] Fix CS --- pkg/amqp-ext/AmqpContext.php | 2 +- pkg/async-event-dispatcher/ContainerAwareRegistry.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/amqp-ext/AmqpContext.php b/pkg/amqp-ext/AmqpContext.php index f13a7a569..cd7145122 100644 --- a/pkg/amqp-ext/AmqpContext.php +++ b/pkg/amqp-ext/AmqpContext.php @@ -243,7 +243,7 @@ public function getExtChannel(): \AMQPChannel if (false == $this->extChannel) { $extChannel = call_user_func($this->extChannelFactory); if (false == $extChannel instanceof \AMQPChannel) { - throw new \LogicException(sprintf('The factory must return instance of AMQPChannel. It returns %s', is_object($extChannel) ? get_class($extChannel) : gettype($extChannel))); + throw new \LogicException(sprintf('The factory must return instance of AMQPChannel. It returns %s', is_object($extChannel) ? $extChannel::class : gettype($extChannel))); } $this->extChannel = $extChannel; diff --git a/pkg/async-event-dispatcher/ContainerAwareRegistry.php b/pkg/async-event-dispatcher/ContainerAwareRegistry.php index 1a895f486..edf8b3ac1 100644 --- a/pkg/async-event-dispatcher/ContainerAwareRegistry.php +++ b/pkg/async-event-dispatcher/ContainerAwareRegistry.php @@ -68,7 +68,7 @@ public function getTransformer($name) $transformer = $this->container->get($this->transformersMap[$name]); if (false == $transformer instanceof EventTransformer) { - throw new \LogicException(sprintf('The container must return instance of %s but got %s', EventTransformer::class, is_object($transformer) ? get_class($transformer) : gettype($transformer))); + throw new \LogicException(sprintf('The container must return instance of %s but got %s', EventTransformer::class, is_object($transformer) ? $transformer::class : gettype($transformer))); } return $transformer; From f9b26f27de17abae3496316c52b93db45a7d2a34 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 16:58:45 +0200 Subject: [PATCH 15/44] Force older AWS SDK version to avoid SQS-JSON requirement --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 936cf9af1..581f95439 100644 --- a/composer.json +++ b/composer.json @@ -74,6 +74,9 @@ "dms/phpunit-arraysubset-asserts": "^0.2.1", "phpspec/prophecy-phpunit": "^2.0" }, + "conflict": { + "aws/aws-sdk-php": ">=3.285.1" + }, "autoload": { "psr-4": { "Enqueue\\AmqpBunny\\": "pkg/amqp-bunny/", From 401396c189c77ccfc72780d380f0a1352a4dc7b1 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 17:08:59 +0200 Subject: [PATCH 16/44] Try with localstack v3 --- composer.json | 3 --- docker-compose.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 581f95439..936cf9af1 100644 --- a/composer.json +++ b/composer.json @@ -74,9 +74,6 @@ "dms/phpunit-arraysubset-asserts": "^0.2.1", "phpspec/prophecy-phpunit": "^2.0" }, - "conflict": { - "aws/aws-sdk-php": ">=3.285.1" - }, "autoload": { "psr-4": { "Enqueue\\AmqpBunny\\": "pkg/amqp-bunny/", diff --git a/docker-compose.yml b/docker-compose.yml index 754356904..20c7da5e7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -127,7 +127,7 @@ services: - '9090:9090' localstack: - image: 'localstack/localstack:0.8.10' + image: 'localstack/localstack:3.0' ports: - '4576:4576' - '4575:4575' From 4cf175dce0e17a7226614452d8b5390473868cc8 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 17:15:48 +0200 Subject: [PATCH 17/44] Re-run please From eff6293100452f96d6aaf7cf1a704dd570a6f687 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 17:21:00 +0200 Subject: [PATCH 18/44] Update localstack env var --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 20c7da5e7..6e3435ac9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -132,7 +132,7 @@ services: - '4576:4576' - '4575:4575' environment: - HOSTNAME_EXTERNAL: 'localstack' + LOCALSTACK_HOST: 'localstack' SERVICES: 'sqs,sns' influxdb: From 92ede9f2ae4e23c0bba4edbde80ff6749bbb8d11 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 17:30:19 +0200 Subject: [PATCH 19/44] Update localstack ports --- docker-compose.yml | 13 ++++++------- docker/bin/test.sh | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6e3435ac9..641391848 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,16 +38,16 @@ services: - PREDIS_DSN=redis+predis://redis - PHPREDIS_DSN=redis+phpredis://redis - GPS_DSN=gps:?projectId=mqdev&emulatorHost=http://google-pubsub:8085 - - SQS_DSN=sqs:?key=key&secret=secret®ion=us-east-1&endpoint=http://localstack:4576&version=latest - - SNS_DSN=sns:?key=key&secret=secret®ion=us-east-1&endpoint=http://localstack:4575&version=latest - - SNSQS_DSN=snsqs:?key=key&secret=secret®ion=us-east-1&sns_endpoint=http://localstack:4575&sqs_endpoint=http://localstack:4576&version=latest + - SQS_DSN=sqs:?key=key&secret=secret®ion=us-east-1&endpoint=http://localstack:4566&version=latest + - SNS_DSN=sns:?key=key&secret=secret®ion=us-east-1&endpoint=http://localstack:4566&version=latest + - SNSQS_DSN=snsqs:?key=key&secret=secret®ion=us-east-1&sns_endpoint=http://localstack:4566&sqs_endpoint=http://localstack:4566&version=latest - WAMP_DSN=wamp://thruway:9090 - REDIS_HOST=redis - REDIS_PORT=6379 - AWS_SQS_KEY=key - AWS_SQS_SECRET=secret - AWS_SQS_REGION=us-east-1 - - AWS_SQS_ENDPOINT=http://localstack:4576 + - AWS_SQS_ENDPOINT=http://localstack:4566 - AWS_SQS_VERSION=latest - BEANSTALKD_DSN=beanstalk://beanstalkd:11300 - GEARMAN_DSN=gearman://gearmand:4730 @@ -129,10 +129,9 @@ services: localstack: image: 'localstack/localstack:3.0' ports: - - '4576:4576' - - '4575:4575' + - '4566:4566' environment: - LOCALSTACK_HOST: 'localstack' + LOCALSTACK_HOST: 'localstack:4566' SERVICES: 'sqs,sns' influxdb: diff --git a/docker/bin/test.sh b/docker/bin/test.sh index 2070584bb..cfc94aab5 100755 --- a/docker/bin/test.sh +++ b/docker/bin/test.sh @@ -39,7 +39,7 @@ waitForService gearmand 4730 50 waitForService kafka 9092 50 waitForService mongo 27017 50 waitForService thruway 9090 50 -waitForService localstack 4576 50 +waitForService localstack 4566 50 php docker/bin/refresh-mysql-database.php || exit 1 php docker/bin/refresh-postgres-database.php || exit 1 From b00b53ead1729fceae0b7263a16e24abb5d59eec Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 17:35:50 +0200 Subject: [PATCH 20/44] =?UTF-8?q?Fix=20the=20matrix=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f05ccc2e3..136623755 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,4 +180,4 @@ jobs: if: ${{ matrix.php != '8.1' && matrix.php != '8.2' }} - run: bin/test.sh --exclude-group=gearman - if: ${{ matrix.php == '8.1' && matrix.php != '8.2' }} + if: ${{ matrix.php == '8.1' || matrix.php == '8.2' }} From 14ac0b6d67a1277241ea083ae18632abfa136d73 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 17:54:29 +0200 Subject: [PATCH 21/44] Refactor doctrine entity annotations into attributes --- pkg/job-queue/Tests/Functional/Entity/Job.php | 48 +++++++------------ .../Tests/Functional/Entity/JobUnique.php | 12 ++--- .../Functional/app/config/config-sf5.yml | 2 +- .../Tests/Functional/app/config/config.yml | 2 +- 4 files changed, 23 insertions(+), 41 deletions(-) diff --git a/pkg/job-queue/Tests/Functional/Entity/Job.php b/pkg/job-queue/Tests/Functional/Entity/Job.php index ccbf4fda9..b6fe7d072 100644 --- a/pkg/job-queue/Tests/Functional/Entity/Job.php +++ b/pkg/job-queue/Tests/Functional/Entity/Job.php @@ -6,97 +6,83 @@ use Doctrine\ORM\Mapping as ORM; use Enqueue\JobQueue\Job as BaseJob; -/** - * @ORM\Entity - * @ORM\Table(name="enqueue_job_queue") - */ +#[ORM\Entity] +#[ORM\Table(name: 'enqueue_job_queue')] class Job extends BaseJob { /** * @var int - * - * @ORM\Column(name="id", type="integer") - * @ORM\Id - * @ORM\GeneratedValue(strategy="AUTO") */ + #[ORM\Column(name: "id", type: "integer")] + #[ORM\Id] + #[ORM\GeneratedValue(strategy: "AUTO")] protected $id; /** * @var string - * - * @ORM\Column(name="owner_id", type="string", nullable=true) */ + #[ORM\Column(name: "owner_id", type: "string", nullable: true)] protected $ownerId; /** * @var string - * - * @ORM\Column(name="name", type="string", nullable=false) */ + #[ORM\Column(name: "name", type: "string", nullable: false)] protected $name; /** * @var string - * - * @ORM\Column(name="status", type="string", nullable=false) */ + #[ORM\Column(name: "status", type: "string", nullable: false)] protected $status; /** * @var bool - * - * @ORM\Column(name="interrupted", type="boolean") */ + #[ORM\Column(name: "interrupted", type: "boolean")] protected $interrupted; /** * @var bool; - * - * @ORM\Column(name="`unique`", type="boolean") */ + #[ORM\Column(name: "`unique`", type: "boolean")] protected $unique; /** * @var Job - * - * @ORM\ManyToOne(targetEntity="Job", inversedBy="childJobs") - * @ORM\JoinColumn(name="root_job_id", referencedColumnName="id", onDelete="CASCADE") */ + #[ORM\ManyToOne(targetEntity: "Job", inversedBy: "childJobs")] + #[ORM\JoinColumn(name: "root_job_id", referencedColumnName: "id", onDelete: "CASCADE")] protected $rootJob; /** * @var Job[] - * - * @ORM\OneToMany(targetEntity="Job", mappedBy="rootJob") */ + #[ORM\OneToMany(targetEntity: "Job", mappedBy: "rootJob")] protected $childJobs; /** * @var \DateTime - * - * @ORM\Column(name="created_at", type="datetime", nullable=false) */ + #[ORM\Column(name: "created_at", type: "datetime", nullable: false)] protected $createdAt; /** * @var \DateTime - * - * @ORM\Column(name="started_at", type="datetime", nullable=true) */ + #[ORM\Column(name: "started_at", type: "datetime", nullable: true)] protected $startedAt; /** * @var \DateTime - * - * @ORM\Column(name="stopped_at", type="datetime", nullable=true) */ + #[ORM\Column(name: "stopped_at", type: "datetime", nullable: true)] protected $stoppedAt; /** * @var array - * - * @ORM\Column(name="data", type="json", nullable=true) */ + #[ORM\Column(name: "data", type: "json", nullable: true)] protected $data; public function __construct() diff --git a/pkg/job-queue/Tests/Functional/Entity/JobUnique.php b/pkg/job-queue/Tests/Functional/Entity/JobUnique.php index 4d8a33745..cb5794ff3 100644 --- a/pkg/job-queue/Tests/Functional/Entity/JobUnique.php +++ b/pkg/job-queue/Tests/Functional/Entity/JobUnique.php @@ -4,15 +4,11 @@ use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity - * @ORM\Table(name="enqueue_job_queue_unique") - */ +#[ORM\Entity] +#[ORM\Table(name: "enqueue_job_queue_unique")] class JobUnique { - /** - * @ORM\Id - * @ORM\Column(name="name", type="string", nullable=false) - */ + #[ORM\Id] + #[ORM\Column(name: "name", type: "string", nullable: false)] protected $name; } diff --git a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml index dd3467e11..cbed49b90 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml @@ -26,7 +26,7 @@ doctrine: mappings: TestEntity: mapping: true - type: annotation + type: attribute dir: '%kernel.project_dir%/Tests/Functional/Entity' alias: 'EnqueueJobQueue' prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' diff --git a/pkg/job-queue/Tests/Functional/app/config/config.yml b/pkg/job-queue/Tests/Functional/app/config/config.yml index 47cded132..0121acdbf 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config.yml @@ -25,7 +25,7 @@ doctrine: mappings: TestEntity: mapping: true - type: annotation + type: attribute dir: '%kernel.project_dir%/Tests/Functional/Entity' alias: 'EnqueueJobQueue' prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' From 45b2eb44b2517113ed0a559206cdf91cb792ffeb Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 18:04:00 +0200 Subject: [PATCH 22/44] =?UTF-8?q?Refactor=20doctrine=20entity=20mapping=20?= =?UTF-8?q?into=20XML=20=E2=80=94=20compatible=20in=20both=20lowest=20and?= =?UTF-8?q?=20dist=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/job-queue/Tests/Functional/Entity/Job.php | 18 ---------------- .../Tests/Functional/Entity/JobUnique.php | 6 ------ .../Functional/app/config/config-sf5.yml | 2 +- .../Tests/Functional/app/config/config.yml | 2 +- .../Tests/Functional/mapping/Job.orm.xml | 21 +++++++++++++++++++ .../Functional/mapping/JobUnique.orm.xml | 8 +++++++ 6 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 pkg/job-queue/Tests/Functional/mapping/Job.orm.xml create mode 100644 pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml diff --git a/pkg/job-queue/Tests/Functional/Entity/Job.php b/pkg/job-queue/Tests/Functional/Entity/Job.php index b6fe7d072..934302721 100644 --- a/pkg/job-queue/Tests/Functional/Entity/Job.php +++ b/pkg/job-queue/Tests/Functional/Entity/Job.php @@ -3,86 +3,68 @@ namespace Enqueue\JobQueue\Tests\Functional\Entity; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\ORM\Mapping as ORM; use Enqueue\JobQueue\Job as BaseJob; -#[ORM\Entity] -#[ORM\Table(name: 'enqueue_job_queue')] class Job extends BaseJob { /** * @var int */ - #[ORM\Column(name: "id", type: "integer")] - #[ORM\Id] - #[ORM\GeneratedValue(strategy: "AUTO")] protected $id; /** * @var string */ - #[ORM\Column(name: "owner_id", type: "string", nullable: true)] protected $ownerId; /** * @var string */ - #[ORM\Column(name: "name", type: "string", nullable: false)] protected $name; /** * @var string */ - #[ORM\Column(name: "status", type: "string", nullable: false)] protected $status; /** * @var bool */ - #[ORM\Column(name: "interrupted", type: "boolean")] protected $interrupted; /** * @var bool; */ - #[ORM\Column(name: "`unique`", type: "boolean")] protected $unique; /** * @var Job */ - #[ORM\ManyToOne(targetEntity: "Job", inversedBy: "childJobs")] - #[ORM\JoinColumn(name: "root_job_id", referencedColumnName: "id", onDelete: "CASCADE")] protected $rootJob; /** * @var Job[] */ - #[ORM\OneToMany(targetEntity: "Job", mappedBy: "rootJob")] protected $childJobs; /** * @var \DateTime */ - #[ORM\Column(name: "created_at", type: "datetime", nullable: false)] protected $createdAt; /** * @var \DateTime */ - #[ORM\Column(name: "started_at", type: "datetime", nullable: true)] protected $startedAt; /** * @var \DateTime */ - #[ORM\Column(name: "stopped_at", type: "datetime", nullable: true)] protected $stoppedAt; /** * @var array */ - #[ORM\Column(name: "data", type: "json", nullable: true)] protected $data; public function __construct() diff --git a/pkg/job-queue/Tests/Functional/Entity/JobUnique.php b/pkg/job-queue/Tests/Functional/Entity/JobUnique.php index cb5794ff3..b6b771e0f 100644 --- a/pkg/job-queue/Tests/Functional/Entity/JobUnique.php +++ b/pkg/job-queue/Tests/Functional/Entity/JobUnique.php @@ -2,13 +2,7 @@ namespace Enqueue\JobQueue\Tests\Functional\Entity; -use Doctrine\ORM\Mapping as ORM; - -#[ORM\Entity] -#[ORM\Table(name: "enqueue_job_queue_unique")] class JobUnique { - #[ORM\Id] - #[ORM\Column(name: "name", type: "string", nullable: false)] protected $name; } diff --git a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml index cbed49b90..f38f4128b 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml @@ -26,7 +26,7 @@ doctrine: mappings: TestEntity: mapping: true - type: attribute + type: xml dir: '%kernel.project_dir%/Tests/Functional/Entity' alias: 'EnqueueJobQueue' prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' diff --git a/pkg/job-queue/Tests/Functional/app/config/config.yml b/pkg/job-queue/Tests/Functional/app/config/config.yml index 0121acdbf..5d7f187df 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config.yml @@ -25,7 +25,7 @@ doctrine: mappings: TestEntity: mapping: true - type: attribute + type: xml dir: '%kernel.project_dir%/Tests/Functional/Entity' alias: 'EnqueueJobQueue' prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' diff --git a/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml b/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml new file mode 100644 index 000000000..61f7d2d78 --- /dev/null +++ b/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml b/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml new file mode 100644 index 000000000..570775ac2 --- /dev/null +++ b/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml @@ -0,0 +1,8 @@ + + + + + + + + From 603b9b46df4910308c750b88958ee471d2efa518 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 18:15:54 +0200 Subject: [PATCH 23/44] Backwards-compatible SQS endpoints pls --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 641391848..b6941df06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -133,6 +133,7 @@ services: environment: LOCALSTACK_HOST: 'localstack:4566' SERVICES: 'sqs,sns' + SQS_ENDPOINT_STRATEGY: 'off' influxdb: image: 'influxdb:latest' From c14d3831b2b4e383bb858fe1623e05e712511a86 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 18:26:08 +0200 Subject: [PATCH 24/44] Derp --- pkg/job-queue/Tests/Functional/app/config/config-sf5.yml | 2 +- pkg/job-queue/Tests/Functional/app/config/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml index f38f4128b..816e7a406 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml @@ -27,7 +27,7 @@ doctrine: TestEntity: mapping: true type: xml - dir: '%kernel.project_dir%/Tests/Functional/Entity' + dir: '%kernel.project_dir%/Tests/Functional/mapping' alias: 'EnqueueJobQueue' prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' is_bundle: false diff --git a/pkg/job-queue/Tests/Functional/app/config/config.yml b/pkg/job-queue/Tests/Functional/app/config/config.yml index 5d7f187df..f31e4347e 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config.yml @@ -26,7 +26,7 @@ doctrine: TestEntity: mapping: true type: xml - dir: '%kernel.project_dir%/Tests/Functional/Entity' + dir: '%kernel.project_dir%/Tests/Functional/mapping' alias: 'EnqueueJobQueue' prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' is_bundle: false From bc5db65577237958a06a5ec84e3598a7f4a5de44 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 19:14:08 +0200 Subject: [PATCH 25/44] Fix mapping in tests --- pkg/job-queue/Tests/Functional/mapping/Job.orm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml b/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml index 61f7d2d78..b12e74577 100644 --- a/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml +++ b/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml @@ -13,9 +13,9 @@ - + - + From 6f6d9b21247cd214514d4af180d74cf4c153ebd4 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 19:30:04 +0200 Subject: [PATCH 26/44] Fix table names --- pkg/job-queue/Tests/Functional/mapping/Job.orm.xml | 2 +- pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml b/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml index b12e74577..282a467bf 100644 --- a/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml +++ b/pkg/job-queue/Tests/Functional/mapping/Job.orm.xml @@ -1,6 +1,6 @@ - + diff --git a/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml b/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml index 570775ac2..096687f29 100644 --- a/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml +++ b/pkg/job-queue/Tests/Functional/mapping/JobUnique.orm.xml @@ -1,6 +1,6 @@ - + From 74b6dc7ac8f0bca4bbb55a1eda76713bdca2a6d6 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 20:00:19 +0200 Subject: [PATCH 27/44] Bump phpunit to 9.6.15 --- composer.json | 2 +- pkg/amqp-bunny/composer.json | 2 +- pkg/amqp-ext/composer.json | 2 +- pkg/amqp-lib/composer.json | 2 +- pkg/amqp-tools/composer.json | 2 +- pkg/async-command/composer.json | 2 +- pkg/async-event-dispatcher/composer.json | 2 +- pkg/dbal/composer.json | 2 +- pkg/enqueue-bundle/composer.json | 2 +- pkg/enqueue/composer.json | 2 +- pkg/fs/composer.json | 2 +- pkg/gearman/composer.json | 2 +- pkg/gps/composer.json | 2 +- pkg/job-queue/composer.json | 2 +- pkg/mongodb/composer.json | 2 +- pkg/monitoring/composer.json | 2 +- pkg/null/composer.json | 2 +- pkg/pheanstalk/composer.json | 2 +- pkg/rdkafka/composer.json | 2 +- pkg/redis/composer.json | 2 +- pkg/simple-client/composer.json | 2 +- pkg/sns/composer.json | 2 +- pkg/snsqs/composer.json | 2 +- pkg/sqs/composer.json | 2 +- pkg/stomp/composer.json | 2 +- pkg/wamp/composer.json | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index 936cf9af1..17eef88fe 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "phpstan/phpstan": "^0.12", "queue-interop/queue-spec": "^0.6.2", "symfony/browser-kit": "^5.4|^6.0|^7.0", diff --git a/pkg/amqp-bunny/composer.json b/pkg/amqp-bunny/composer.json index b17794aba..4ad6e0525 100644 --- a/pkg/amqp-bunny/composer.json +++ b/pkg/amqp-bunny/composer.json @@ -13,7 +13,7 @@ "enqueue/amqp-tools": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" diff --git a/pkg/amqp-ext/composer.json b/pkg/amqp-ext/composer.json index bf8840016..71306ff64 100644 --- a/pkg/amqp-ext/composer.json +++ b/pkg/amqp-ext/composer.json @@ -13,7 +13,7 @@ "enqueue/amqp-tools": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2", diff --git a/pkg/amqp-lib/composer.json b/pkg/amqp-lib/composer.json index 72645cc63..2449a68cc 100644 --- a/pkg/amqp-lib/composer.json +++ b/pkg/amqp-lib/composer.json @@ -13,7 +13,7 @@ "enqueue/amqp-tools": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" diff --git a/pkg/amqp-tools/composer.json b/pkg/amqp-tools/composer.json index 2fdce7d08..de0ef7892 100644 --- a/pkg/amqp-tools/composer.json +++ b/pkg/amqp-tools/composer.json @@ -12,7 +12,7 @@ "enqueue/dsn": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev" }, diff --git a/pkg/async-command/composer.json b/pkg/async-command/composer.json index 0956d9d18..738d6191e 100644 --- a/pkg/async-command/composer.json +++ b/pkg/async-command/composer.json @@ -13,7 +13,7 @@ "symfony/process": "^5.4|^6.0|^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "symfony/dependency-injection": "^5.4|^6.0|^7.0", "symfony/config": "^5.4|^6.0|^7.0", "symfony/http-kernel": "^5.4|^6.0|^7.0", diff --git a/pkg/async-event-dispatcher/composer.json b/pkg/async-event-dispatcher/composer.json index 630a4b2f0..2f6b914a1 100644 --- a/pkg/async-event-dispatcher/composer.json +++ b/pkg/async-event-dispatcher/composer.json @@ -12,7 +12,7 @@ "symfony/event-dispatcher": "^5.4|^6.0|^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "symfony/dependency-injection": "^5.4|^6.0|^7.0", "symfony/config": "^5.4|^6.0|^7.0", "symfony/http-kernel": "^5.4|^6.0|^7.0", diff --git a/pkg/dbal/composer.json b/pkg/dbal/composer.json index f36790e03..45d93087f 100644 --- a/pkg/dbal/composer.json +++ b/pkg/dbal/composer.json @@ -13,7 +13,7 @@ "ramsey/uuid": "^3.5|^4" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index 1ac1c94c8..08f1469c2 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -21,7 +21,7 @@ "docs": "https://github.com/php-enqueue/enqueue-dev/blob/master/docs/index.md" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/stomp": "0.10.x-dev", "enqueue/amqp-ext": "0.10.x-dev", "enqueue/amqp-lib": "0.10.x-dev", diff --git a/pkg/enqueue/composer.json b/pkg/enqueue/composer.json index c71b0554a..4299493ad 100644 --- a/pkg/enqueue/composer.json +++ b/pkg/enqueue/composer.json @@ -16,7 +16,7 @@ "psr/container": "^1.1 || ^2.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "symfony/console": "^5.41|^6.0|^7.0", "symfony/dependency-injection": "^5.4|^6.0|^7.0", "symfony/config": "^5.4|^6.0|^7.0", diff --git a/pkg/fs/composer.json b/pkg/fs/composer.json index 42e807170..0666e429c 100644 --- a/pkg/fs/composer.json +++ b/pkg/fs/composer.json @@ -13,7 +13,7 @@ "makasim/temp-file": "^0.2@stable" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/null": "0.10.x-dev", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2", diff --git a/pkg/gearman/composer.json b/pkg/gearman/composer.json index 70194a1e4..b0b1e01f1 100644 --- a/pkg/gearman/composer.json +++ b/pkg/gearman/composer.json @@ -11,7 +11,7 @@ "queue-interop/queue-interop": "^0.8" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" diff --git a/pkg/gps/composer.json b/pkg/gps/composer.json index c8190eebb..485db2598 100644 --- a/pkg/gps/composer.json +++ b/pkg/gps/composer.json @@ -12,7 +12,7 @@ "enqueue/dsn": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" }, diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index 8eaf93f37..10f9dc8cd 100644 --- a/pkg/job-queue/composer.json +++ b/pkg/job-queue/composer.json @@ -14,7 +14,7 @@ "doctrine/dbal": "^2.12 | ^3.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "doctrine/doctrine-bundle": "^2.3.2", "symfony/browser-kit": "^5.4|^6.0|^7.0", diff --git a/pkg/mongodb/composer.json b/pkg/mongodb/composer.json index fece9c6eb..99e47afb1 100644 --- a/pkg/mongodb/composer.json +++ b/pkg/mongodb/composer.json @@ -16,7 +16,7 @@ "ext-mongodb": "^1.5" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "queue-interop/queue-spec": "^0.6.2", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev" diff --git a/pkg/monitoring/composer.json b/pkg/monitoring/composer.json index 78c6d6977..a8dde648d 100644 --- a/pkg/monitoring/composer.json +++ b/pkg/monitoring/composer.json @@ -11,7 +11,7 @@ "enqueue/dsn": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "influxdb/influxdb-php": "^1.14", "datadog/php-datadogstatsd": "^1.3", diff --git a/pkg/null/composer.json b/pkg/null/composer.json index 108b26510..4f3a121ef 100644 --- a/pkg/null/composer.json +++ b/pkg/null/composer.json @@ -10,7 +10,7 @@ "queue-interop/queue-interop": "^0.8" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" }, diff --git a/pkg/pheanstalk/composer.json b/pkg/pheanstalk/composer.json index 563aff876..e7d1f0dd6 100644 --- a/pkg/pheanstalk/composer.json +++ b/pkg/pheanstalk/composer.json @@ -11,7 +11,7 @@ "queue-interop/queue-interop": "^0.8" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" diff --git a/pkg/rdkafka/composer.json b/pkg/rdkafka/composer.json index b3c45ea5e..40c532bc6 100644 --- a/pkg/rdkafka/composer.json +++ b/pkg/rdkafka/composer.json @@ -11,7 +11,7 @@ "queue-interop/queue-interop": "^0.8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2", diff --git a/pkg/redis/composer.json b/pkg/redis/composer.json index 1a407dc87..263eca52b 100644 --- a/pkg/redis/composer.json +++ b/pkg/redis/composer.json @@ -12,7 +12,7 @@ "ramsey/uuid": "^3.5|^4" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "predis/predis": "^1.1", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", diff --git a/pkg/simple-client/composer.json b/pkg/simple-client/composer.json index 1ed3554a6..be01585c8 100644 --- a/pkg/simple-client/composer.json +++ b/pkg/simple-client/composer.json @@ -13,7 +13,7 @@ "symfony/config": "^5.4|^6.0|^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/amqp-ext": "0.10.x-dev", "enqueue/fs": "0.10.x-dev", diff --git a/pkg/sns/composer.json b/pkg/sns/composer.json index b406b6737..8da57e7c5 100644 --- a/pkg/sns/composer.json +++ b/pkg/sns/composer.json @@ -12,7 +12,7 @@ "aws/aws-sdk-php": "~3.155" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" }, diff --git a/pkg/snsqs/composer.json b/pkg/snsqs/composer.json index f9d3c286e..6b40c8431 100644 --- a/pkg/snsqs/composer.json +++ b/pkg/snsqs/composer.json @@ -13,7 +13,7 @@ "enqueue/sqs": "^0.10" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" }, diff --git a/pkg/sqs/composer.json b/pkg/sqs/composer.json index ac63dcb1d..a88ba3ba6 100644 --- a/pkg/sqs/composer.json +++ b/pkg/sqs/composer.json @@ -12,7 +12,7 @@ "aws/aws-sdk-php": "~3.155" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" }, diff --git a/pkg/stomp/composer.json b/pkg/stomp/composer.json index f2509ebfb..2fd956ea1 100644 --- a/pkg/stomp/composer.json +++ b/pkg/stomp/composer.json @@ -17,7 +17,7 @@ "php-http/discovery": "^1.13" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" diff --git a/pkg/wamp/composer.json b/pkg/wamp/composer.json index 1f32ad3ae..a03d9a84d 100644 --- a/pkg/wamp/composer.json +++ b/pkg/wamp/composer.json @@ -17,7 +17,7 @@ "react/promise": "^2.8" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.15", "enqueue/test": "0.10.x-dev", "enqueue/null": "0.10.x-dev", "queue-interop/queue-spec": "^0.6.2" From 5aaab0c03abbae7501515957f1bffa6f8fe60019 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 20:15:21 +0200 Subject: [PATCH 28/44] Fix deprecation --- pkg/enqueue/Client/DriverFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/enqueue/Client/DriverFactory.php b/pkg/enqueue/Client/DriverFactory.php index 0dd9412d8..a9864cf64 100644 --- a/pkg/enqueue/Client/DriverFactory.php +++ b/pkg/enqueue/Client/DriverFactory.php @@ -84,7 +84,7 @@ private function findDriverInfo(Dsn $dsn, array $factories): ?array private function createRabbitMqStompDriver(ConnectionFactory $factory, Dsn $dsn, Config $config, RouteCollection $collection): RabbitMqStompDriver { $defaultManagementHost = $dsn->getHost() ?: $config->getTransportOption('host', 'localhost'); - $managementVast = ltrim($dsn->getPath(), '/') ?: $config->getTransportOption('vhost', '/'); + $managementVast = ltrim((string) $dsn->getPath(), '/') ?: $config->getTransportOption('vhost', '/'); $managementClient = StompManagementClient::create( urldecode($managementVast), From 313a569ac6109392ec5b43d76caadcb5201acb8d Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 20:17:24 +0200 Subject: [PATCH 29/44] Re-run please From 5341f51f77da0f849ceaa23b4ed3c3dfd31ede57 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 20:19:34 +0200 Subject: [PATCH 30/44] Fix CS --- pkg/enqueue/Client/DriverFactory.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/enqueue/Client/DriverFactory.php b/pkg/enqueue/Client/DriverFactory.php index a9864cf64..e017afc70 100644 --- a/pkg/enqueue/Client/DriverFactory.php +++ b/pkg/enqueue/Client/DriverFactory.php @@ -31,11 +31,7 @@ public function create(ConnectionFactory $factory, Config $config, RouteCollecti $knownDrivers = Resources::getKnownDrivers(); if ($driverInfo = $this->findDriverInfo($dsn, $knownDrivers)) { - throw new \LogicException(sprintf( - 'To use given scheme "%s" a package has to be installed. Run "composer req %s" to add it.', - $dsn->getScheme(), - implode(' ', $driverInfo['packages']) - )); + throw new \LogicException(sprintf('To use given scheme "%s" a package has to be installed. Run "composer req %s" to add it.', $dsn->getScheme(), implode(' ', $driverInfo['packages']))); } throw new \LogicException(sprintf( From f2b6241463898f2f7382ee5c2749b93c77ee2e04 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 21:04:51 +0200 Subject: [PATCH 31/44] Fix more deprecations --- pkg/amqp-bunny/AmqpContext.php | 6 +++--- pkg/amqp-bunny/AmqpProducer.php | 6 +++--- pkg/amqp-ext/AmqpConsumer.php | 2 +- pkg/enqueue/Symfony/Client/ConsumeCommand.php | 2 +- pkg/enqueue/Symfony/Client/ProduceCommand.php | 2 +- pkg/enqueue/Symfony/Client/RoutesCommand.php | 2 +- pkg/enqueue/Symfony/Client/SetupBrokerCommand.php | 2 +- .../Symfony/Consumption/ConfigurableConsumeCommand.php | 2 +- pkg/enqueue/Symfony/Consumption/ConsumeCommand.php | 2 +- pkg/enqueue/Tests/Mocks/JsonSerializableObject.php | 2 +- pkg/enqueue/Tests/Util/Fixtures/JsonSerializableClass.php | 2 +- pkg/redis/PhpRedis.php | 4 ++-- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pkg/amqp-bunny/AmqpContext.php b/pkg/amqp-bunny/AmqpContext.php index f57554335..246475c73 100644 --- a/pkg/amqp-bunny/AmqpContext.php +++ b/pkg/amqp-bunny/AmqpContext.php @@ -218,7 +218,7 @@ public function bind(InteropAmqpBind $bind): void $this->getBunnyChannel()->exchangeBind( $bind->getTarget()->getTopicName(), $bind->getSource()->getTopicName(), - $bind->getRoutingKey(), + (string) $bind->getRoutingKey(), (bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT), $bind->getArguments() ); @@ -227,7 +227,7 @@ public function bind(InteropAmqpBind $bind): void $this->getBunnyChannel()->queueBind( $bind->getSource()->getQueueName(), $bind->getTarget()->getTopicName(), - $bind->getRoutingKey(), + (string) $bind->getRoutingKey(), (bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT), $bind->getArguments() ); @@ -236,7 +236,7 @@ public function bind(InteropAmqpBind $bind): void $this->getBunnyChannel()->queueBind( $bind->getTarget()->getQueueName(), $bind->getSource()->getTopicName(), - $bind->getRoutingKey(), + (string) $bind->getRoutingKey(), (bool) ($bind->getFlags() & InteropAmqpBind::FLAG_NOWAIT), $bind->getArguments() ); diff --git a/pkg/amqp-bunny/AmqpProducer.php b/pkg/amqp-bunny/AmqpProducer.php index 76892ebeb..ba18c881b 100644 --- a/pkg/amqp-bunny/AmqpProducer.php +++ b/pkg/amqp-bunny/AmqpProducer.php @@ -152,8 +152,8 @@ private function doSend(InteropAmqpDestination $destination, InteropAmqpMessage $this->channel->publish( $message->getBody(), $amqpProperties, - $destination->getTopicName(), - $message->getRoutingKey(), + (string) $destination->getTopicName(), + (string) $message->getRoutingKey(), (bool) ($message->getFlags() & InteropAmqpMessage::FLAG_MANDATORY), (bool) ($message->getFlags() & InteropAmqpMessage::FLAG_IMMEDIATE) ); @@ -162,7 +162,7 @@ private function doSend(InteropAmqpDestination $destination, InteropAmqpMessage $message->getBody(), $amqpProperties, '', - $destination->getQueueName(), + (string) $destination->getQueueName(), (bool) ($message->getFlags() & InteropAmqpMessage::FLAG_MANDATORY), (bool) ($message->getFlags() & InteropAmqpMessage::FLAG_IMMEDIATE) ); diff --git a/pkg/amqp-ext/AmqpConsumer.php b/pkg/amqp-ext/AmqpConsumer.php index 03c949714..a53e3802e 100644 --- a/pkg/amqp-ext/AmqpConsumer.php +++ b/pkg/amqp-ext/AmqpConsumer.php @@ -118,7 +118,7 @@ public function acknowledge(Message $message): void { InvalidMessageException::assertMessageInstanceOf($message, InteropAmqpMessage::class); - $this->getExtQueue()->ack($message->getDeliveryTag()); + $this->getExtQueue()->ack((int) $message->getDeliveryTag()); } /** diff --git a/pkg/enqueue/Symfony/Client/ConsumeCommand.php b/pkg/enqueue/Symfony/Client/ConsumeCommand.php index 39af6d592..b6a283b9f 100644 --- a/pkg/enqueue/Symfony/Client/ConsumeCommand.php +++ b/pkg/enqueue/Symfony/Client/ConsumeCommand.php @@ -96,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $consumer = $this->getQueueConsumer($client); } catch (NotFoundExceptionInterface $e) { - throw new \LogicException(sprintf('Client "%s" is not supported.', $client), null, $e); + throw new \LogicException(message: sprintf('Client "%s" is not supported.', $client), previous: $e); } $driver = $this->getDriver($client); diff --git a/pkg/enqueue/Symfony/Client/ProduceCommand.php b/pkg/enqueue/Symfony/Client/ProduceCommand.php index 6064f82e1..5db37a94e 100644 --- a/pkg/enqueue/Symfony/Client/ProduceCommand.php +++ b/pkg/enqueue/Symfony/Client/ProduceCommand.php @@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $producer = $this->getProducer($client); } catch (NotFoundExceptionInterface $e) { - throw new \LogicException(sprintf('Client "%s" is not supported.', $client), null, $e); + throw new \LogicException(message: sprintf('Client "%s" is not supported.', $client), previous: $e); } if ($topic) { diff --git a/pkg/enqueue/Symfony/Client/RoutesCommand.php b/pkg/enqueue/Symfony/Client/RoutesCommand.php index 59a4a4d98..61c503164 100644 --- a/pkg/enqueue/Symfony/Client/RoutesCommand.php +++ b/pkg/enqueue/Symfony/Client/RoutesCommand.php @@ -65,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $this->driver = $this->getDriver($input->getOption('client')); } catch (NotFoundExceptionInterface $e) { - throw new \LogicException(sprintf('Client "%s" is not supported.', $input->getOption('client')), null, $e); + throw new \LogicException(message: sprintf('Client "%s" is not supported.', $input->getOption('client')), previous: $e); } $routes = $this->driver->getRouteCollection()->all(); diff --git a/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php b/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php index 68aebb582..6cdb45124 100644 --- a/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php +++ b/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $this->getDriver($client)->setupBroker(new ConsoleLogger($output)); } catch (NotFoundExceptionInterface $e) { - throw new \LogicException(sprintf('Client "%s" is not supported.', $client), null, $e); + throw new \LogicException(message: sprintf('Client "%s" is not supported.', $client), previous: $e); } $output->writeln('Broker set up'); diff --git a/pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php b/pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php index 234eb0497..aa673cd1a 100644 --- a/pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php +++ b/pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php @@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int try { $consumer = $this->getQueueConsumer($transport); } catch (NotFoundExceptionInterface $e) { - throw new \LogicException(sprintf('Transport "%s" is not supported.', $transport), null, $e); + throw new \LogicException(message: sprintf('Transport "%s" is not supported.', $transport), previous: $e); } $this->setQueueConsumerOptions($consumer, $input); diff --git a/pkg/enqueue/Symfony/Consumption/ConsumeCommand.php b/pkg/enqueue/Symfony/Consumption/ConsumeCommand.php index 870cc5f60..8cc9e54a4 100644 --- a/pkg/enqueue/Symfony/Consumption/ConsumeCommand.php +++ b/pkg/enqueue/Symfony/Consumption/ConsumeCommand.php @@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // QueueConsumer must be pre configured outside of the command! $consumer = $this->getQueueConsumer($transport); } catch (NotFoundExceptionInterface $e) { - throw new \LogicException(sprintf('Transport "%s" is not supported.', $transport), null, $e); + throw new \LogicException(message: sprintf('Transport "%s" is not supported.', $transport), previous: $e); } $this->setQueueConsumerOptions($consumer, $input); diff --git a/pkg/enqueue/Tests/Mocks/JsonSerializableObject.php b/pkg/enqueue/Tests/Mocks/JsonSerializableObject.php index 5b74106dc..e1cc91475 100644 --- a/pkg/enqueue/Tests/Mocks/JsonSerializableObject.php +++ b/pkg/enqueue/Tests/Mocks/JsonSerializableObject.php @@ -4,7 +4,7 @@ class JsonSerializableObject implements \JsonSerializable { - public function jsonSerialize() + public function jsonSerialize(): array { return ['foo' => 'fooVal']; } diff --git a/pkg/enqueue/Tests/Util/Fixtures/JsonSerializableClass.php b/pkg/enqueue/Tests/Util/Fixtures/JsonSerializableClass.php index b612978e7..26a8cb569 100644 --- a/pkg/enqueue/Tests/Util/Fixtures/JsonSerializableClass.php +++ b/pkg/enqueue/Tests/Util/Fixtures/JsonSerializableClass.php @@ -6,7 +6,7 @@ class JsonSerializableClass implements \JsonSerializable { public $keyPublic = 'public'; - public function jsonSerialize() + public function jsonSerialize(): array { return [ 'key' => 'value', diff --git a/pkg/redis/PhpRedis.php b/pkg/redis/PhpRedis.php index d6f5baffa..b4195b215 100644 --- a/pkg/redis/PhpRedis.php +++ b/pkg/redis/PhpRedis.php @@ -115,8 +115,8 @@ public function connect(): void $this->config['port'], $this->config['timeout'], $this->config['persistent'] ? ($this->config['phpredis_persistent_id'] ?? null) : null, - $this->config['phpredis_retry_interval'] ?? null, - $this->config['read_write_timeout'] + (int) ($this->config['phpredis_retry_interval'] ?? null), + (int) $this->config['read_write_timeout'] ); if (false == $result) { From bfc1d65df1241d35dfcf816d50151641d916ec4e Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 21:09:43 +0200 Subject: [PATCH 32/44] Fix CS --- pkg/amqp-bunny/AmqpContext.php | 6 +----- pkg/amqp-ext/AmqpConsumer.php | 4 ++-- pkg/enqueue/Client/DriverFactory.php | 6 +----- pkg/redis/PhpRedis.php | 8 ++------ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/pkg/amqp-bunny/AmqpContext.php b/pkg/amqp-bunny/AmqpContext.php index 246475c73..495be0823 100644 --- a/pkg/amqp-bunny/AmqpContext.php +++ b/pkg/amqp-bunny/AmqpContext.php @@ -51,7 +51,6 @@ class AmqpContext implements InteropAmqpContext, DelayStrategyAware * Callable must return instance of \Bunny\Channel once called. * * @param Channel|callable $bunnyChannel - * @param array $config */ public function __construct($bunnyChannel, array $config) { @@ -294,10 +293,7 @@ public function getBunnyChannel(): Channel if (false == $this->bunnyChannel) { $bunnyChannel = call_user_func($this->bunnyChannelFactory); if (false == $bunnyChannel instanceof Channel) { - throw new \LogicException(sprintf( - 'The factory must return instance of \Bunny\Channel. It returned %s', - is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel) - )); + throw new \LogicException(sprintf('The factory must return instance of \Bunny\Channel. It returned %s', is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel))); } $this->bunnyChannel = $bunnyChannel; diff --git a/pkg/amqp-ext/AmqpConsumer.php b/pkg/amqp-ext/AmqpConsumer.php index a53e3802e..2a380ee82 100644 --- a/pkg/amqp-ext/AmqpConsumer.php +++ b/pkg/amqp-ext/AmqpConsumer.php @@ -93,7 +93,7 @@ public function receive(int $timeout = 0): ?Message return $message; } - usleep(100000); //100ms + usleep(100000); // 100ms } return null; @@ -130,7 +130,7 @@ public function reject(Message $message, bool $requeue = false): void $this->getExtQueue()->reject( $message->getDeliveryTag(), - $requeue ? AMQP_REQUEUE : AMQP_NOPARAM + $requeue ? \AMQP_REQUEUE : \AMQP_NOPARAM ); } diff --git a/pkg/enqueue/Client/DriverFactory.php b/pkg/enqueue/Client/DriverFactory.php index e017afc70..70539d837 100644 --- a/pkg/enqueue/Client/DriverFactory.php +++ b/pkg/enqueue/Client/DriverFactory.php @@ -34,11 +34,7 @@ public function create(ConnectionFactory $factory, Config $config, RouteCollecti throw new \LogicException(sprintf('To use given scheme "%s" a package has to be installed. Run "composer req %s" to add it.', $dsn->getScheme(), implode(' ', $driverInfo['packages']))); } - throw new \LogicException(sprintf( - 'A given scheme "%s" is not supported. Maybe it is a custom driver, make sure you registered it with "%s::addDriver".', - $dsn->getScheme(), - Resources::class - )); + throw new \LogicException(sprintf('A given scheme "%s" is not supported. Maybe it is a custom driver, make sure you registered it with "%s::addDriver".', $dsn->getScheme(), Resources::class)); } private function findDriverInfo(Dsn $dsn, array $factories): ?array diff --git a/pkg/redis/PhpRedis.php b/pkg/redis/PhpRedis.php index b4195b215..b81e7e64f 100644 --- a/pkg/redis/PhpRedis.php +++ b/pkg/redis/PhpRedis.php @@ -96,18 +96,14 @@ public function connect(): void $supportedSchemes = ['redis', 'rediss', 'tcp', 'unix']; if (false == in_array($this->config['scheme'], $supportedSchemes, true)) { - throw new \LogicException(sprintf( - 'The given scheme protocol "%s" is not supported by php extension. It must be one of "%s"', - $this->config['scheme'], - implode('", "', $supportedSchemes) - )); + throw new \LogicException(sprintf('The given scheme protocol "%s" is not supported by php extension. It must be one of "%s"', $this->config['scheme'], implode('", "', $supportedSchemes))); } $this->redis = new \Redis(); $connectionMethod = $this->config['persistent'] ? 'pconnect' : 'connect'; - $host = $this->config['scheme'] === 'rediss' ? 'tls://' . $this->config['host'] : $this->config['host']; + $host = 'rediss' === $this->config['scheme'] ? 'tls://' . $this->config['host'] : $this->config['host']; $result = call_user_func( [$this->redis, $connectionMethod], From 169c9e315ad1e4b39b522d9cf155ef5e03470258 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 21:17:23 +0200 Subject: [PATCH 33/44] Fix newer sf compat --- .../DependencyInjection/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/async-event-dispatcher/DependencyInjection/Configuration.php b/pkg/async-event-dispatcher/DependencyInjection/Configuration.php index 56151e956..785d17197 100644 --- a/pkg/async-event-dispatcher/DependencyInjection/Configuration.php +++ b/pkg/async-event-dispatcher/DependencyInjection/Configuration.php @@ -10,7 +10,7 @@ class Configuration implements ConfigurationInterface /** * {@inheritdoc} */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { if (method_exists(TreeBuilder::class, 'getRootNode')) { $tb = new TreeBuilder('enqueue_async_event_dispatcher'); From 3bf83cf3e943f799a4de97e0fbd99f02593cce52 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 28 Dec 2023 21:26:39 +0200 Subject: [PATCH 34/44] Bump amqplib to avoid deprecations --- composer.json | 2 +- pkg/amqp-lib/composer.json | 2 +- pkg/enqueue-bundle/composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 17eef88fe..6bdb16877 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8.1", "bunny/bunny": "^0.4|^0.5", - "php-amqplib/php-amqplib": "^3.0", + "php-amqplib/php-amqplib": "^3.6", "doctrine/dbal": "^2.12|^3.1", "ramsey/uuid": "^3.5|^4", "psr/log": "^1.1 || ^2.0 || ^3.0", diff --git a/pkg/amqp-lib/composer.json b/pkg/amqp-lib/composer.json index 2449a68cc..3001efd55 100644 --- a/pkg/amqp-lib/composer.json +++ b/pkg/amqp-lib/composer.json @@ -7,7 +7,7 @@ "license": "MIT", "require": { "php": "^8.0", - "php-amqplib/php-amqplib": "^3.2", + "php-amqplib/php-amqplib": "^3.6", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "enqueue/amqp-tools": "^0.10" diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index 08f1469c2..aa21ec754 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -35,7 +35,7 @@ "enqueue/test": "0.10.x-dev", "enqueue/async-event-dispatcher": "0.10.x-dev", "enqueue/async-command": "0.10.x-dev", - "php-amqplib/php-amqplib": "^3.0", + "php-amqplib/php-amqplib": "^3.6", "doctrine/doctrine-bundle": "^2.3.2", "doctrine/mongodb-odm-bundle": "^3.5|^4.3|5.0.x-dev", "alcaeus/mongo-php-adapter": "^1.0", From 462660c81319eef5b5a38f7f68734f608f3612c4 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Fri, 29 Dec 2023 11:01:12 +0200 Subject: [PATCH 35/44] Fix CS, bump cs-fixer --- composer.json | 2 +- pkg/amqp-bunny/AmqpContext.php | 2 +- .../DependencyInjection/Configuration.php | 3 --- pkg/redis/PhpRedis.php | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 6bdb16877..3223b837f 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "doctrine/mongodb-odm-bundle": "^3.5|^4.3|5.0.x-dev", "alcaeus/mongo-php-adapter": "^1.0", "kwn/php-rdkafka-stubs": "^2.0.3", - "friendsofphp/php-cs-fixer": "^3.4", + "friendsofphp/php-cs-fixer": "^3.43", "dms/phpunit-arraysubset-asserts": "^0.2.1", "phpspec/prophecy-phpunit": "^2.0" }, diff --git a/pkg/amqp-bunny/AmqpContext.php b/pkg/amqp-bunny/AmqpContext.php index 495be0823..35405ac9a 100644 --- a/pkg/amqp-bunny/AmqpContext.php +++ b/pkg/amqp-bunny/AmqpContext.php @@ -293,7 +293,7 @@ public function getBunnyChannel(): Channel if (false == $this->bunnyChannel) { $bunnyChannel = call_user_func($this->bunnyChannelFactory); if (false == $bunnyChannel instanceof Channel) { - throw new \LogicException(sprintf('The factory must return instance of \Bunny\Channel. It returned %s', is_object($bunnyChannel) ? get_class($bunnyChannel) : gettype($bunnyChannel))); + throw new \LogicException(sprintf('The factory must return instance of \Bunny\Channel. It returned %s', is_object($bunnyChannel) ? $bunnyChannel::class : gettype($bunnyChannel))); } $this->bunnyChannel = $bunnyChannel; diff --git a/pkg/async-event-dispatcher/DependencyInjection/Configuration.php b/pkg/async-event-dispatcher/DependencyInjection/Configuration.php index 785d17197..7b85a469d 100644 --- a/pkg/async-event-dispatcher/DependencyInjection/Configuration.php +++ b/pkg/async-event-dispatcher/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder(): TreeBuilder { if (method_exists(TreeBuilder::class, 'getRootNode')) { diff --git a/pkg/redis/PhpRedis.php b/pkg/redis/PhpRedis.php index b81e7e64f..023b87563 100644 --- a/pkg/redis/PhpRedis.php +++ b/pkg/redis/PhpRedis.php @@ -103,7 +103,7 @@ public function connect(): void $connectionMethod = $this->config['persistent'] ? 'pconnect' : 'connect'; - $host = 'rediss' === $this->config['scheme'] ? 'tls://' . $this->config['host'] : $this->config['host']; + $host = 'rediss' === $this->config['scheme'] ? 'tls://'.$this->config['host'] : $this->config['host']; $result = call_user_func( [$this->redis, $connectionMethod], From 1df30878489fad9e3b817c17fffa3dbf1b13cd60 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Fri, 29 Dec 2023 19:03:54 +0200 Subject: [PATCH 36/44] Try sleeping? --- .../Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php b/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php index e370c1f32..e5da88635 100644 --- a/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php +++ b/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php @@ -34,6 +34,9 @@ protected function createTopic(Context $context, $topicName) protected function createQueue(Context $context, $queueName) { - return $this->createSnsQsQueue($queueName); + $result = $this->createSnsQsQueue($queueName); + sleep(1); + + return $result; } } From 4e1f44deead4c1ed6755210f1238ed9460692ba5 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Fri, 29 Dec 2023 19:25:22 +0200 Subject: [PATCH 37/44] One more deprecation --- pkg/job-queue/Test/DbalPersistedConnection.php | 2 +- .../Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/job-queue/Test/DbalPersistedConnection.php b/pkg/job-queue/Test/DbalPersistedConnection.php index add0f3ddc..0a4671373 100644 --- a/pkg/job-queue/Test/DbalPersistedConnection.php +++ b/pkg/job-queue/Test/DbalPersistedConnection.php @@ -142,7 +142,7 @@ private function wrapTransactionNestingLevel($method) $this->setTransactionNestingLevel($this->getPersistedTransactionNestingLevel()); try { - call_user_func(['parent', $method]); + call_user_func([parent::class, $method]); } catch (\Exception $e) { } diff --git a/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php b/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php index e5da88635..13c74fa28 100644 --- a/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php +++ b/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php @@ -36,7 +36,7 @@ protected function createQueue(Context $context, $queueName) { $result = $this->createSnsQsQueue($queueName); sleep(1); - + return $result; } } From 083459806e2208519292730e13b8c9253a3f0dc2 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Fri, 29 Dec 2023 19:27:03 +0200 Subject: [PATCH 38/44] Fix CS --- pkg/job-queue/Test/DbalPersistedConnection.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/job-queue/Test/DbalPersistedConnection.php b/pkg/job-queue/Test/DbalPersistedConnection.php index 0a4671373..781ecba43 100644 --- a/pkg/job-queue/Test/DbalPersistedConnection.php +++ b/pkg/job-queue/Test/DbalPersistedConnection.php @@ -22,9 +22,6 @@ class DbalPersistedConnection extends Connection */ protected static $persistedTransactionNestingLevels; - /** - * {@inheritdoc} - */ public function connect() { if ($this->isConnected()) { @@ -41,25 +38,16 @@ public function connect() return true; } - /** - * {@inheritdoc} - */ public function beginTransaction() { $this->wrapTransactionNestingLevel('beginTransaction'); } - /** - * {@inheritdoc} - */ public function commit() { $this->wrapTransactionNestingLevel('commit'); } - /** - * {@inheritdoc} - */ public function rollBack() { $this->wrapTransactionNestingLevel('rollBack'); From 4eb3b572829446a4fe4a2f266f73fd64bc81546d Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Wed, 3 Jan 2024 16:07:59 +0200 Subject: [PATCH 39/44] Fix a deprecation --- pkg/job-queue/Test/DbalPersistedConnection.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/job-queue/Test/DbalPersistedConnection.php b/pkg/job-queue/Test/DbalPersistedConnection.php index 781ecba43..64ffe46c4 100644 --- a/pkg/job-queue/Test/DbalPersistedConnection.php +++ b/pkg/job-queue/Test/DbalPersistedConnection.php @@ -40,17 +40,17 @@ public function connect() public function beginTransaction() { - $this->wrapTransactionNestingLevel('beginTransaction'); + return $this->wrapTransactionNestingLevel('beginTransaction'); } public function commit() { - $this->wrapTransactionNestingLevel('commit'); + return $this->wrapTransactionNestingLevel('commit'); } public function rollBack() { - $this->wrapTransactionNestingLevel('rollBack'); + return $this->wrapTransactionNestingLevel('rollBack'); } /** @@ -123,14 +123,14 @@ private function setTransactionNestingLevel($level) * * @throws \Exception */ - private function wrapTransactionNestingLevel($method) + private function wrapTransactionNestingLevel($method): bool { $e = null; $this->setTransactionNestingLevel($this->getPersistedTransactionNestingLevel()); try { - call_user_func([parent::class, $method]); + $result = call_user_func([parent::class, $method]); } catch (\Exception $e) { } @@ -139,5 +139,7 @@ private function wrapTransactionNestingLevel($method) if ($e) { throw $e; } + + return $result; } } From 7f5ad7376cb02d23647f3a4f8623e7fa1db154c1 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Wed, 3 Jan 2024 16:08:55 +0200 Subject: [PATCH 40/44] Try eager localstack service loading --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index b6941df06..360fcbfda 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -134,6 +134,7 @@ services: LOCALSTACK_HOST: 'localstack:4566' SERVICES: 'sqs,sns' SQS_ENDPOINT_STRATEGY: 'off' + EAGER_SERVICE_LOADING: 1 influxdb: image: 'influxdb:latest' From b031bcafc05b821989403b3fa6d057b74fba0e82 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Wed, 3 Jan 2024 16:20:37 +0200 Subject: [PATCH 41/44] Move the sleep --- pkg/snsqs/Tests/Spec/SnsQsFactoryTrait.php | 5 +++++ .../Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/snsqs/Tests/Spec/SnsQsFactoryTrait.php b/pkg/snsqs/Tests/Spec/SnsQsFactoryTrait.php index efc4a7046..0d1e9087f 100644 --- a/pkg/snsqs/Tests/Spec/SnsQsFactoryTrait.php +++ b/pkg/snsqs/Tests/Spec/SnsQsFactoryTrait.php @@ -37,9 +37,14 @@ protected function createSnsQsQueue(string $queueName): SnsQsQueue $this->snsQsQueue = $this->snsQsContext->createQueue($queueName); $this->snsQsContext->declareQueue($this->snsQsQueue); + echo "Declared queue $queueName\n"; + ob_flush(); + sleep(1); if ($this->snsQsTopic) { $this->snsQsContext->bind($this->snsQsTopic, $this->snsQsQueue); + echo "Bound queue $queueName to topic\n"; + ob_flush(); } return $this->snsQsQueue; diff --git a/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php b/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php index 13c74fa28..433fcf3a7 100644 --- a/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php +++ b/pkg/snsqs/Tests/Spec/SnsQsSendToTopicAndReceiveNoWaitFromQueueTest.php @@ -8,6 +8,7 @@ /** * @group functional + * * @retry 5 */ class SnsQsSendToTopicAndReceiveNoWaitFromQueueTest extends SendToTopicAndReceiveNoWaitFromQueueSpec @@ -34,9 +35,6 @@ protected function createTopic(Context $context, $topicName) protected function createQueue(Context $context, $queueName) { - $result = $this->createSnsQsQueue($queueName); - sleep(1); - - return $result; + return $this->createSnsQsQueue($queueName); } } From ffec2befb655a2dcaef2b32e3a31dd1c0655fb57 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 4 Apr 2024 09:48:22 +0300 Subject: [PATCH 42/44] Run the CI again From c7d74b5f7b13ec6c405760a8b88e08b996b5fbdf Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 4 Apr 2024 10:16:09 +0300 Subject: [PATCH 43/44] Fix CS --- pkg/amqp-bunny/AmqpProducer.php | 6 +++--- pkg/amqp-ext/AmqpConsumer.php | 2 +- .../ContainerAwareRegistry.php | 2 +- .../Tests/Functional/app/AppKernel.php | 17 ++++++++++------- pkg/snsqs/Tests/Spec/SnsQsFactoryTrait.php | 4 ++-- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pkg/amqp-bunny/AmqpProducer.php b/pkg/amqp-bunny/AmqpProducer.php index ba18c881b..a5ce5484b 100644 --- a/pkg/amqp-bunny/AmqpProducer.php +++ b/pkg/amqp-bunny/AmqpProducer.php @@ -79,7 +79,7 @@ public function send(Destination $destination, Message $message): void /** * @return self */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $this->delayStrategy) { throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt(); @@ -98,7 +98,7 @@ public function getDeliveryDelay(): ?int /** * @return self */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -113,7 +113,7 @@ public function getPriority(): ?int /** * @return self */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/amqp-ext/AmqpConsumer.php b/pkg/amqp-ext/AmqpConsumer.php index 2a380ee82..e3ad2d9b6 100644 --- a/pkg/amqp-ext/AmqpConsumer.php +++ b/pkg/amqp-ext/AmqpConsumer.php @@ -43,7 +43,7 @@ public function __construct(AmqpContext $context, InteropAmqpQueue $queue) $this->flags = self::FLAG_NOPARAM; } - public function setConsumerTag(string $consumerTag = null): void + public function setConsumerTag(?string $consumerTag = null): void { $this->consumerTag = $consumerTag; } diff --git a/pkg/async-event-dispatcher/ContainerAwareRegistry.php b/pkg/async-event-dispatcher/ContainerAwareRegistry.php index edf8b3ac1..01adeb3a9 100644 --- a/pkg/async-event-dispatcher/ContainerAwareRegistry.php +++ b/pkg/async-event-dispatcher/ContainerAwareRegistry.php @@ -28,7 +28,7 @@ public function __construct(array $eventsMap, array $transformersMap) $this->transformersMap = $transformersMap; } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/pkg/job-queue/Tests/Functional/app/AppKernel.php b/pkg/job-queue/Tests/Functional/app/AppKernel.php index 61793010f..e8f2af933 100644 --- a/pkg/job-queue/Tests/Functional/app/AppKernel.php +++ b/pkg/job-queue/Tests/Functional/app/AppKernel.php @@ -1,20 +1,23 @@ snsQsQueue = $this->snsQsContext->createQueue($queueName); $this->snsQsContext->declareQueue($this->snsQsQueue); @@ -52,7 +52,7 @@ protected function createSnsQsQueue(string $queueName): SnsQsQueue protected function createSnsQsTopic(string $topicName): SnsQsTopic { - $topicName = $topicName.time(); + $topicName .= time(); $this->snsQsTopic = $this->snsQsContext->createTopic($topicName); $this->snsQsContext->declareTopic($this->snsQsTopic); From cbabc2362e5e7fb897bf26890874d4b167581f41 Mon Sep 17 00:00:00 2001 From: Andrew M-Y Date: Thu, 4 Apr 2024 10:39:31 +0300 Subject: [PATCH 44/44] Launch localstack with debug --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 360fcbfda..86f31be78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -135,6 +135,7 @@ services: SERVICES: 'sqs,sns' SQS_ENDPOINT_STRATEGY: 'off' EAGER_SERVICE_LOADING: 1 + DEBUG: 1 influxdb: image: 'influxdb:latest'