From e996ed979462d18c690b741ec7a3ed42762fe250 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Fri, 18 Apr 2025 10:39:29 +0300 Subject: [PATCH 01/57] Release 0.10.25 Signed-off-by: Maksim Kotlyar --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4643cc9c9..ebba0c73f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [0.10.25](https://github.com/php-enqueue/enqueue-dev/tree/0.10.25) (2025-04-18) +[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.10.24...0.10.25) + +**Merged pull requests:** + +- Bugfix/static drift [\#1373](https://github.com/php-enqueue/enqueue-dev/pull/1373) ([JimTools](https://github.com/JimTools)) +- CS Fixes [\#1372](https://github.com/php-enqueue/enqueue-dev/pull/1372) ([JimTools](https://github.com/JimTools)) +- Fixing risky tests [\#1371](https://github.com/php-enqueue/enqueue-dev/pull/1371) ([JimTools](https://github.com/JimTools)) + ## [0.10.24](https://github.com/php-enqueue/enqueue-dev/tree/0.10.24) (2024-11-30) [Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.10.23...0.10.24) From c5a021fa8ad78d92a1ec95dd8b72a79fd3705204 Mon Sep 17 00:00:00 2001 From: James Read Date: Sun, 27 Apr 2025 14:30:31 +0100 Subject: [PATCH 02/57] Updating composer Updating composer.json in pkg directory to correctly reflect the supported versions of PHP --- composer.json | 4 ++-- 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/dsn/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, 27 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index d2258474d..f06367b09 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "ext-amqp": "^1.9.3|^2.0.0", "ext-gearman": "^2.0", - "ext-mongodb": "^1.5", + "ext-mongodb": "^1.17", "ext-rdkafka": "^4.0|^5.0|^6.0", "queue-interop/amqp-interop": "^0.8.2", @@ -127,7 +127,7 @@ "ext-rdkafka": "4.0", "ext-bcmath": "1", "ext-mbstring": "1", - "ext-mongo": "1.6.14", + "ext-mongodb": "1.17.3", "ext-sockets": "1" }, "prefer-stable": true, diff --git a/pkg/amqp-bunny/composer.json b/pkg/amqp-bunny/composer.json index 5bffcebd8..84d0f4309 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.1", "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/composer.json b/pkg/amqp-ext/composer.json index b81363bb9..99f88c507 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.1", "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/composer.json b/pkg/amqp-lib/composer.json index dfb73a311..62f906c66 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.1", "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/composer.json b/pkg/amqp-tools/composer.json index 55f82f5d7..966e065e8 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.1", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10" diff --git a/pkg/async-command/composer.json b/pkg/async-command/composer.json index 48fd6f089..95d57ce3a 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.1", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", "symfony/console": "^5.4|^6.0", diff --git a/pkg/async-event-dispatcher/composer.json b/pkg/async-event-dispatcher/composer.json index a2cef0d79..f78597af4 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.1", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", "symfony/event-dispatcher": "^5.4|^6.0" diff --git a/pkg/dbal/composer.json b/pkg/dbal/composer.json index a4d4af7f4..9499d394d 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.1", "queue-interop/queue-interop": "^0.8", "doctrine/dbal": "^2.12|^3.1", "doctrine/persistence": "^2.0|^3.0", 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/composer.json b/pkg/enqueue/composer.json index 0da00ee4b..c336c4bad 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.1", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", "enqueue/null": "^0.10", diff --git a/pkg/fs/composer.json b/pkg/fs/composer.json index b44900541..4dd2ff806 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.1", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "symfony/filesystem": "^5.4|^6.0", diff --git a/pkg/gearman/composer.json b/pkg/gearman/composer.json index eb06f62e3..e8805849f 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.1", "ext-gearman": "^2.0", "queue-interop/queue-interop": "^0.8" }, diff --git a/pkg/gps/composer.json b/pkg/gps/composer.json index 2da6b7468..e7654be8d 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.1", "queue-interop/queue-interop": "^0.8", "google/cloud-pubsub": "^1.4.3", "enqueue/dsn": "^0.10" diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index 55d37d5da..6616069b3 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.1", "enqueue/enqueue": "^0.10", "enqueue/null": "^0.10", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/mongodb/composer.json b/pkg/mongodb/composer.json index 775452949..f64d53ef3 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.1", "queue-interop/queue-interop": "^0.8", "mongodb/mongodb": "^1.2", "ext-mongodb": "^1.5" diff --git a/pkg/monitoring/composer.json b/pkg/monitoring/composer.json index e19da2fa9..13b57a5f2 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.1", "enqueue/enqueue": "^0.10", "enqueue/dsn": "^0.10" }, diff --git a/pkg/null/composer.json b/pkg/null/composer.json index 0f4ac4eeb..a09910a47 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.1", "queue-interop/queue-interop": "^0.8" }, "require-dev": { diff --git a/pkg/pheanstalk/composer.json b/pkg/pheanstalk/composer.json index 8d920a4ff..c810971c8 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.1", "pda/pheanstalk": "^3.1", "queue-interop/queue-interop": "^0.8" }, diff --git a/pkg/rdkafka/composer.json b/pkg/rdkafka/composer.json index 068b9d204..64afe05ec 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.1", "ext-rdkafka": "^4.0|^5.0|^6.0", "queue-interop/queue-interop": "^0.8.1" }, diff --git a/pkg/redis/composer.json b/pkg/redis/composer.json index 4742b3385..c48323201 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.1", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "ramsey/uuid": "^3.5|^4" diff --git a/pkg/simple-client/composer.json b/pkg/simple-client/composer.json index 7cb07b6b3..2d2bd3710 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.1", "enqueue/enqueue": "^0.10", "queue-interop/amqp-interop": "^0.8.2", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/sns/composer.json b/pkg/sns/composer.json index 3bf50bdaf..6873037e3 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.1", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "aws/aws-sdk-php": "^3.290" diff --git a/pkg/snsqs/composer.json b/pkg/snsqs/composer.json index 27a4e038e..e0596b25b 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.1", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "enqueue/sns": "^0.10", diff --git a/pkg/sqs/composer.json b/pkg/sqs/composer.json index cd50faf29..2ddc1b267 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.1", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", "aws/aws-sdk-php": "^3.290" diff --git a/pkg/stomp/composer.json b/pkg/stomp/composer.json index 461205852..2cceb9fea 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.1", "enqueue/dsn": "^0.10", "stomp-php/stomp-php": "^4.5|^5.0", "queue-interop/queue-interop": "^0.8", diff --git a/pkg/wamp/composer.json b/pkg/wamp/composer.json index be0321c6f..b510627bd 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.1", "queue-interop/queue-interop": "^0.8.1", "enqueue/dsn": "^0.10.8", "thruway/client": "^0.5.5", From f5ea51496bb6dcfc2ced939c3782b61ef9463b2a Mon Sep 17 00:00:00 2001 From: James Read Date: Sat, 19 Apr 2025 00:22:06 +0100 Subject: [PATCH 03/57] Fixing CI There's an issue with the downstream PPA "ondrej/php" where is cannot find the gearman package. Refactoring Dockerfile to use standard base images as a workaround --- .github/workflows/ci.yml | 8 +- docker-compose.yml | 6 +- docker/Dockerfile | 91 +++++++---------------- docker/bin/dev_entrypoiny.sh | 2 +- docker/bin/test.sh | 2 +- pkg/rdkafka/Tests/RdKafkaConsumerTest.php | 1 + 6 files changed, 33 insertions(+), 77 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36c3d5d90..cd701ad76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,10 +162,4 @@ jobs: env: PHP_VERSION: ${{ matrix.php }} - # TODO: convert these two steps into one w/o excludes when Gearman extension gets a release for PHP 8.1 - # See https://github.com/php/pecl-networking-gearman/issues/16 - - run: bin/test.sh - 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' }} + - run: bin/test.sh --group=functional diff --git a/docker-compose.yml b/docker-compose.yml index 8851efc28..b724d7881 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,11 @@ -version: '2' - services: dev: # when image publishing gets sorted: -# image: enqueue/dev:${PHP_VERSION:-7.4} + # image: enqueue/dev:${PHP_VERSION:-8.2} build: context: docker args: - PHP_VERSION: "${PHP_VERSION:-8.1}" + PHP_VERSION: "${PHP_VERSION:-8.2}" depends_on: - rabbitmq - mysql diff --git a/docker/Dockerfile b/docker/Dockerfile index b2f30c62e..c54a29866 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,71 +1,34 @@ ARG PHP_VERSION=8.2 -FROM makasim/nginx-php-fpm:${PHP_VERSION}-all-exts +FROM php:${PHP_VERSION}-alpine ARG PHP_VERSION -## libs -RUN set -x && \ - apt-get update && \ - apt-get install -y --no-install-recommends --no-install-suggests \ - wget \ - curl \ - openssl \ - ca-certificates \ - nano \ - netcat \ - php${PHP_VERSION}-dev \ - php${PHP_VERSION}-redis \ - php${PHP_VERSION}-pgsql \ - git \ - python \ - php${PHP_VERSION}-amqp \ - php${PHP_VERSION}-xml \ - php${PHP_VERSION}-mysql \ - php${PHP_VERSION}-curl \ - php${PHP_VERSION}-mongodb \ - php${PHP_VERSION}-mbstring \ - make \ - g++ \ - unzip \ - && \ - update-alternatives --install /usr/bin/php php /usr/bin/php${PHP_VERSION} 100 - -## gearman -RUN set -x && \ - apt-get install -y --no-install-recommends --no-install-suggests \ - libgearman-dev \ - && \ - mkdir -p $HOME/gearman && \ - cd $HOME/gearman && \ - git clone https://github.com/php/pecl-networking-gearman.git . && \ - git checkout gearman-2.1.0 && \ - phpize && ./configure && make && make install && \ - if [ ! -f /etc/php/${PHP_VERSION}/cli/conf.d/20-gearman.ini ]; then \ - echo "extension=gearman.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-gearman.ini && \ - echo "extension=gearman.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/20-gearman.ini \ - ; \ - fi; - -## librdkafka -RUN set -x && \ - mkdir -p $HOME/librdkafka && \ - cd $HOME/librdkafka && \ - git clone https://github.com/edenhill/librdkafka.git . && \ - git checkout v1.0.0 && \ - ./configure && make && make install - -## php-rdkafka -RUN set -x && \ - mkdir -p $HOME/php-rdkafka && \ - cd $HOME/php-rdkafka && \ - git clone https://github.com/arnaud-lb/php-rdkafka.git . && \ - git checkout 5.0.1 && \ - phpize && ./configure && make all && make install && \ - echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/cli/conf.d/10-rdkafka.ini && \ - echo "extension=rdkafka.so" > /etc/php/${PHP_VERSION}/fpm/conf.d/10-rdkafka.ini - -COPY ./php/cli.ini /etc/php/${PHP_VERSION}/cli/conf.d/1-dev_cli.ini +RUN --mount=type=cache,target=/var/cache/apk apk add --no-cache $PHPIZE_DEPS \ + libpq-dev \ + librdkafka-dev \ + rabbitmq-c-dev \ + linux-headers && \ + apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \ + gearman-dev + +# Install First Party Modules +RUN docker-php-ext-install -j$(nproc) \ + pcntl \ + pdo_mysql \ + pdo_pgsql + +# Install Third Party Modules +RUN --mount=type=cache,target=/tmp/pear pecl install redis \ + mongodb-1.21.0 \ + gearman \ + rdkafka \ + xdebug && \ + pecl install --configureoptions 'with-librabbitmq-dir="autodetect"' amqp +RUN docker-php-ext-enable redis mongodb gearman rdkafka xdebug amqp + +COPY ./php/cli.ini /usr/local/etc/php/conf.d/1-dev_cli COPY ./bin/dev_entrypoiny.sh /usr/local/bin/entrypoint.sh +RUN mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini RUN chmod u+x /usr/local/bin/entrypoint.sh RUN mkdir -p /mqdev @@ -73,4 +36,4 @@ WORKDIR /mqdev COPY --from=composer:2 /usr/bin/composer /usr/bin/composer -CMD /usr/local/bin/entrypoint.sh +CMD ["/usr/local/bin/entrypoint.sh"] diff --git a/docker/bin/dev_entrypoiny.sh b/docker/bin/dev_entrypoiny.sh index a18b06b1e..c56e146fa 100644 --- a/docker/bin/dev_entrypoiny.sh +++ b/docker/bin/dev_entrypoiny.sh @@ -1,3 +1,3 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh while true; do sleep 1; done diff --git a/docker/bin/test.sh b/docker/bin/test.sh index b78e1c1a8..6bd094b75 100755 --- a/docker/bin/test.sh +++ b/docker/bin/test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # wait for service # $1 host diff --git a/pkg/rdkafka/Tests/RdKafkaConsumerTest.php b/pkg/rdkafka/Tests/RdKafkaConsumerTest.php index a0544da6c..e577dfcca 100644 --- a/pkg/rdkafka/Tests/RdKafkaConsumerTest.php +++ b/pkg/rdkafka/Tests/RdKafkaConsumerTest.php @@ -190,6 +190,7 @@ public function testShouldReceiveFromQueueAndReturnMessageIfMessageInQueue() $kafkaMessage = new Message(); $kafkaMessage->err = \RD_KAFKA_RESP_ERR_NO_ERROR; $kafkaMessage->payload = 'theSerializedMessage'; + $kafkaMessage->partition = 0; $kafkaConsumer = $this->createKafkaConsumerMock(); $kafkaConsumer From be50d68d40c96dd537234edc75b878004e0d1127 Mon Sep 17 00:00:00 2001 From: James Read Date: Sat, 19 Apr 2025 00:47:49 +0100 Subject: [PATCH 04/57] Updating action versions to latest --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd701ad76..52e438f8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,9 @@ jobs: name: Static analysis runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: technote-space/get-diff-action@v4 + - uses: technote-space/get-diff-action@v6 with: PATTERNS: | pkg/**/*.php @@ -25,7 +25,7 @@ jobs: - run: php ./bin/fix-symfony-version.php "5.4.*" - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php @@ -37,9 +37,9 @@ jobs: name: Code style check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: technote-space/get-diff-action@v4 + - uses: technote-space/get-diff-action@v6 with: PATTERNS: | pkg/**/*.php @@ -49,7 +49,7 @@ jobs: run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: composer-cs-check-${{ hashFiles('**/composer.json') }} @@ -87,14 +87,14 @@ jobs: name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get Composer Cache Directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} @@ -131,14 +131,14 @@ jobs: name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get Composer Cache Directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} From 7482b263916c802f341a579d317700e418bcd6b3 Mon Sep 17 00:00:00 2001 From: James Read Date: Sat, 19 Apr 2025 13:32:34 +0100 Subject: [PATCH 05/57] Updting lowest dep Updating the lowest dependecy until deprication warnings are fix. --- composer.json | 24 +++++++++---------- pkg/dbal/DbalConsumerHelperTrait.php | 4 ++-- pkg/enqueue/Client/DriverFactory.php | 2 +- pkg/enqueue/Symfony/Client/ConsumeCommand.php | 2 +- pkg/enqueue/Symfony/Client/ProduceCommand.php | 2 +- pkg/enqueue/Symfony/Client/RoutesCommand.php | 2 +- .../Symfony/Client/SetupBrokerCommand.php | 2 +- .../ConfigurableConsumeCommand.php | 2 +- .../Symfony/Consumption/ConsumeCommand.php | 2 +- pkg/redis/PhpRedis.php | 4 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index f06367b09..215507e9d 100644 --- a/composer.json +++ b/composer.json @@ -18,30 +18,30 @@ "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", - "doctrine/dbal": "^2.12|^3.1", - "ramsey/uuid": "^3.5|^4", + "bunny/bunny": "^0.5.5", + "php-amqplib/php-amqplib": "^3.1", + "doctrine/dbal": "^3.2", + "ramsey/uuid": "^4.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "psr/container": "^1.1 || ^2.0", "makasim/temp-file": "^0.2", - "google/cloud-pubsub": "^1.4.3", + "google/cloud-pubsub": "^1.46", "doctrine/orm": "^2.12", "doctrine/persistence": "^2.0|^3.0", - "mongodb/mongodb": "^1.2", + "mongodb/mongodb": "^1.17", "pda/pheanstalk": "^3.1", "aws/aws-sdk-php": "^3.290", - "stomp-php/stomp-php": "^4.5|^5", + "stomp-php/stomp-php": "^5.1", "php-http/guzzle7-adapter": "^0.1.1", "php-http/client-common": "^2.2.1", "andrewmy/rabbitmq-management-api": "^2.1.2", - "predis/predis": "^1.1", + "predis/predis": "^2.1", "thruway/client": "^0.5.5", - "thruway/pawl-transport": "^0.5.1", + "thruway/pawl-transport": "^0.5.2", "influxdb/influxdb-php": "^1.14", "datadog/php-datadogstatsd": "^1.3", "guzzlehttp/guzzle": "^7.0.1", - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^1.9.1", "php-http/discovery": "^1.13", "voryx/thruway-common": "^1.0.1", "react/dns": "^1.4", @@ -50,7 +50,7 @@ }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.5.28", "phpstan/phpstan": "^1.0", "queue-interop/queue-spec": "^0.6.2", "symfony/browser-kit": "^6.2|^7.0", @@ -67,7 +67,7 @@ "symfony/yaml": "^6.2|^7.0", "empi89/php-amqp-stubs": "*@dev", "doctrine/doctrine-bundle": "^2.3.2", - "doctrine/mongodb-odm-bundle": "^3.5|^4.3|^5.0", + "doctrine/mongodb-odm-bundle": "^4.7|^5.0", "alcaeus/mongo-php-adapter": "^1.0", "kwn/php-rdkafka-stubs": "^2.0.3", "friendsofphp/php-cs-fixer": "^3.4", diff --git a/pkg/dbal/DbalConsumerHelperTrait.php b/pkg/dbal/DbalConsumerHelperTrait.php index 4a3d32997..617f37ba0 100644 --- a/pkg/dbal/DbalConsumerHelperTrait.php +++ b/pkg/dbal/DbalConsumerHelperTrait.php @@ -53,7 +53,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa while (microtime(true) < $endAt) { try { - $result = $select->execute()->fetch(); + $result = $select->execute()->fetchAssociative(); if (empty($result)) { return null; } @@ -69,7 +69,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa ->setParameter('deliveryId', $deliveryId, DbalType::GUID) ->setMaxResults(1) ->execute() - ->fetch(); + ->fetchAssociative(); // the message has been removed by a 3rd party, such as truncate operation. if (false === $deliveredMessage) { diff --git a/pkg/enqueue/Client/DriverFactory.php b/pkg/enqueue/Client/DriverFactory.php index 1d383ac86..5c827e7e7 100644 --- a/pkg/enqueue/Client/DriverFactory.php +++ b/pkg/enqueue/Client/DriverFactory.php @@ -76,7 +76,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($dsn->getPath() ?? '', '/') ?: $config->getTransportOption('vhost', '/'); $managementClient = StompManagementClient::create( urldecode($managementVast), diff --git a/pkg/enqueue/Symfony/Client/ConsumeCommand.php b/pkg/enqueue/Symfony/Client/ConsumeCommand.php index 5a0676705..94b56ad10 100644 --- a/pkg/enqueue/Symfony/Client/ConsumeCommand.php +++ b/pkg/enqueue/Symfony/Client/ConsumeCommand.php @@ -94,7 +94,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(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 bd23c16c3..953a76687 100644 --- a/pkg/enqueue/Symfony/Client/ProduceCommand.php +++ b/pkg/enqueue/Symfony/Client/ProduceCommand.php @@ -67,7 +67,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(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 0646e37bb..04b657ef7 100644 --- a/pkg/enqueue/Symfony/Client/RoutesCommand.php +++ b/pkg/enqueue/Symfony/Client/RoutesCommand.php @@ -63,7 +63,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(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 b74902aa6..92d5ad022 100644 --- a/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php +++ b/pkg/enqueue/Symfony/Client/SetupBrokerCommand.php @@ -55,7 +55,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(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 230a0dc69..34cb66d57 100644 --- a/pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php +++ b/pkg/enqueue/Symfony/Consumption/ConfigurableConsumeCommand.php @@ -79,7 +79,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(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 1c82f3cfb..b69ae7269 100644 --- a/pkg/enqueue/Symfony/Consumption/ConsumeCommand.php +++ b/pkg/enqueue/Symfony/Consumption/ConsumeCommand.php @@ -65,7 +65,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(sprintf('Transport "%s" is not supported.', $transport), previous: $e); } $this->setQueueConsumerOptions($consumer, $input); diff --git a/pkg/redis/PhpRedis.php b/pkg/redis/PhpRedis.php index 1a229e3c9..9e820a283 100644 --- a/pkg/redis/PhpRedis.php +++ b/pkg/redis/PhpRedis.php @@ -111,8 +111,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'] ?? 0), + (float) $this->config['read_write_timeout'] ?? 0 ); if (false == $result) { From d4d3896f7fffa39689b48403fc4da6de3d6139cb Mon Sep 17 00:00:00 2001 From: James Read Date: Sat, 19 Apr 2025 14:41:40 +0100 Subject: [PATCH 06/57] bump lowest doctrine-bundle version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 215507e9d..94d6e2b0e 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "symfony/validator": "^6.2|^7.0", "symfony/yaml": "^6.2|^7.0", "empi89/php-amqp-stubs": "*@dev", - "doctrine/doctrine-bundle": "^2.3.2", + "doctrine/doctrine-bundle": "^2.5", "doctrine/mongodb-odm-bundle": "^4.7|^5.0", "alcaeus/mongo-php-adapter": "^1.0", "kwn/php-rdkafka-stubs": "^2.0.3", From 64f3d47e3b2f7ed6d4212f10e6ac1f56edb13d08 Mon Sep 17 00:00:00 2001 From: James Read Date: Sun, 27 Apr 2025 17:54:00 +0100 Subject: [PATCH 07/57] fix: raising minimum stability Rasing minimum-stability from beta to stable --- composer.json | 2 +- docker/bin/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 94d6e2b0e..75ff4424a 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "enqueue/enqueue-dev", "type": "project", - "minimum-stability": "beta", + "minimum-stability": "stable", "homepage": "https://enqueue.forma-pro.com/", "scripts": { "cs-fix": "bin/php-cs-fixer fix", diff --git a/docker/bin/test.sh b/docker/bin/test.sh index 6bd094b75..db9431780 100755 --- a/docker/bin/test.sh +++ b/docker/bin/test.sh @@ -12,7 +12,7 @@ function waitForService() ATTEMPTS=0 until nc -z $1 $2; do printf "wait for service %s:%s\n" $1 $2 - ((ATTEMPTS++)) + ATTEMPTS=$((ATTEMPTS++)) if [ $ATTEMPTS -ge $3 ]; then printf "service is not running %s:%s\n" $1 $2 exit 1 From e49cb215dee909ee4fecef738df6a8ef7ac37477 Mon Sep 17 00:00:00 2001 From: James Read Date: Sun, 27 Apr 2025 18:43:44 +0100 Subject: [PATCH 08/57] fix: removing memory limit for unit tests Removing the memory limit when unit tests are running --- bin/fix-symfony-version.php | 2 +- docker/bin/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/fix-symfony-version.php b/bin/fix-symfony-version.php index aac84f081..6eaafebab 100644 --- a/bin/fix-symfony-version.php +++ b/bin/fix-symfony-version.php @@ -6,7 +6,7 @@ $newVersion = $argv[1]; -$composer = file_get_contents(__DIR__.'/../composer.json'); +$composer = trim(file_get_contents(__DIR__.'/../composer.json')); $updatedComposer = preg_replace('/"symfony\/(.*)": ".*"/', '"symfony/$1": "'.$newVersion.'"', $composer).\PHP_EOL; echo $updatedComposer.\PHP_EOL; diff --git a/docker/bin/test.sh b/docker/bin/test.sh index db9431780..1a6d35453 100755 --- a/docker/bin/test.sh +++ b/docker/bin/test.sh @@ -47,4 +47,4 @@ php pkg/job-queue/Tests/Functional/app/console doctrine:database:create --if-not php pkg/job-queue/Tests/Functional/app/console doctrine:schema:update --force --complete || exit 1 #php pkg/enqueue-bundle/Tests/Functional/app/console.php config:dump-reference enqueue -bin/phpunit "$@" +php -d memory_limit=-1 bin/phpunit "$@" From 17d4ce3cdd7f0c89e7d436d731fc34982f321601 Mon Sep 17 00:00:00 2001 From: James Read Date: Sun, 27 Apr 2025 18:59:05 +0100 Subject: [PATCH 09/57] fix: updating symfony versions --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52e438f8b..caff1b0c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,11 +122,15 @@ jobs: fail-fast: false matrix: php: [ '8.1', '8.2' ] - symfony_version: [ '6.2.*', '6.3.*', '6.4.*', '7.0.*' ] + symfony_version: [ '6.4.*', '7.0.*', '7.1.*', '7.2.*' ] dependencies: [ '--prefer-lowest', '--prefer-dist' ] exclude: - php: '8.1' symfony_version: '7.0.*' + - php: '8.1' + symfony_version: '7.1.*' + - php: '8.1' + symfony_version: '7.2.*' name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} From 1bf5b7dc1165a8fa39ef79aade1cdd86b8292d0e Mon Sep 17 00:00:00 2001 From: James Read Date: Wed, 30 Apr 2025 20:16:12 +0100 Subject: [PATCH 10/57] fix: cleaner logs --- docker/Dockerfile | 2 +- docker/php/cli.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c54a29866..9e7a0b71b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -26,7 +26,7 @@ RUN --mount=type=cache,target=/tmp/pear pecl install redis \ pecl install --configureoptions 'with-librabbitmq-dir="autodetect"' amqp RUN docker-php-ext-enable redis mongodb gearman rdkafka xdebug amqp -COPY ./php/cli.ini /usr/local/etc/php/conf.d/1-dev_cli +COPY ./php/cli.ini /usr/local/etc/php/conf.d/.user.ini COPY ./bin/dev_entrypoiny.sh /usr/local/bin/entrypoint.sh RUN mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini RUN chmod u+x /usr/local/bin/entrypoint.sh diff --git a/docker/php/cli.ini b/docker/php/cli.ini index e308fbb9d..40361c920 100644 --- a/docker/php/cli.ini +++ b/docker/php/cli.ini @@ -1,4 +1,4 @@ -error_reporting=E_ALL +error_reporting=E_ALL&~E_DEPRECATED&~E_USER_DEPRECATED display_errors=on memory_limit = 2G max_execution_time=0 From f5759ec59075dbd909ae1f3151649dab1f7d1867 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Sat, 10 May 2025 18:42:20 +0300 Subject: [PATCH 11/57] Release 0.10.26 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebba0c73f..fe4ddabbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## [0.10.26](https://github.com/php-enqueue/enqueue-dev/tree/0.10.26) (2025-05-10) +[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.10.25...0.10.26) + +**Merged pull requests:** + +- Fix: Updating composer [\#1383](https://github.com/php-enqueue/enqueue-dev/pull/1383) ([JimTools](https://github.com/JimTools)) +- Fix: Fixing CI [\#1382](https://github.com/php-enqueue/enqueue-dev/pull/1382) ([JimTools](https://github.com/JimTools)) + ## [0.10.25](https://github.com/php-enqueue/enqueue-dev/tree/0.10.25) (2025-04-18) [Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.10.24...0.10.25) From d64d4c697ff5e6e56c3dfcea7d04e14d05e21908 Mon Sep 17 00:00:00 2001 From: Kevin Pfeifer Date: Sat, 21 Jun 2025 15:27:55 +0200 Subject: [PATCH 12/57] add symfony 7 support + adjust CI --- pkg/simple-client/.github/workflows/ci.yml | 6 +++--- pkg/simple-client/composer.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/simple-client/.github/workflows/ci.yml b/pkg/simple-client/.github/workflows/ci.yml index 6b24b0f30..604442a2f 100644 --- a/pkg/simple-client/.github/workflows/ci.yml +++ b/pkg/simple-client/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: @@ -24,7 +24,7 @@ jobs: - run: php Tests/fix_composer_json.php - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/simple-client/composer.json b/pkg/simple-client/composer.json index 2d2bd3710..03bda03b4 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": "^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^9.5", From 7ae57bacc920a220b54ae184b20e42d893f5bfa2 Mon Sep 17 00:00:00 2001 From: Marin Binzari Date: Wed, 16 Jul 2025 16:44:49 +0300 Subject: [PATCH 13/57] Improve log extension to avoid unique messages --- pkg/enqueue/Consumption/Extension/LogExtension.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/enqueue/Consumption/Extension/LogExtension.php b/pkg/enqueue/Consumption/Extension/LogExtension.php index 14383c4d1..2520d7806 100644 --- a/pkg/enqueue/Consumption/Extension/LogExtension.php +++ b/pkg/enqueue/Consumption/Extension/LogExtension.php @@ -30,7 +30,7 @@ public function onMessageReceived(MessageReceived $context): void { $message = $context->getMessage(); - $context->getLogger()->debug("Received from {queueName}\t{body}", [ + $context->getLogger()->debug("Received from {queueName}", [ 'queueName' => $context->getConsumer()->getQueue()->getQueueName(), 'redelivered' => $message->isRedelivered(), 'body' => Stringify::that($message->getBody()), @@ -45,12 +45,13 @@ public function onPostMessageReceived(PostMessageReceived $context): void $queue = $context->getConsumer()->getQueue(); $result = $context->getResult(); + $logMessage = "Processed from {queueName}"; + $reason = ''; - $logMessage = "Processed from {queueName}\t{body}\t{result}"; if ($result instanceof Result && $result->getReason()) { $reason = $result->getReason(); - $logMessage .= ' {reason}'; } + $logContext = [ 'result' => str_replace('enqueue.', '', $result), 'reason' => $reason, From 89d252e374f5b5c394750e575fcf9df18a62e61c Mon Sep 17 00:00:00 2001 From: Marin Binzari Date: Thu, 17 Jul 2025 07:28:47 +0300 Subject: [PATCH 14/57] fix tests --- pkg/enqueue/Consumption/Extension/LogExtension.php | 4 ++-- .../Client/ConsumptionExtension/LogExtensionTest.php | 10 +++++----- .../Tests/Consumption/Extension/LogExtensionTest.php | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/enqueue/Consumption/Extension/LogExtension.php b/pkg/enqueue/Consumption/Extension/LogExtension.php index 2520d7806..6338ad314 100644 --- a/pkg/enqueue/Consumption/Extension/LogExtension.php +++ b/pkg/enqueue/Consumption/Extension/LogExtension.php @@ -30,7 +30,7 @@ public function onMessageReceived(MessageReceived $context): void { $message = $context->getMessage(); - $context->getLogger()->debug("Received from {queueName}", [ + $context->getLogger()->debug('Received from {queueName}', [ 'queueName' => $context->getConsumer()->getQueue()->getQueueName(), 'redelivered' => $message->isRedelivered(), 'body' => Stringify::that($message->getBody()), @@ -45,7 +45,7 @@ public function onPostMessageReceived(PostMessageReceived $context): void $queue = $context->getConsumer()->getQueue(); $result = $context->getResult(); - $logMessage = "Processed from {queueName}"; + $logMessage = 'Processed from {queueName}'; $reason = ''; if ($result instanceof Result && $result->getReason()) { diff --git a/pkg/enqueue/Tests/Client/ConsumptionExtension/LogExtensionTest.php b/pkg/enqueue/Tests/Client/ConsumptionExtension/LogExtensionTest.php index db757676b..383ec4d9b 100644 --- a/pkg/enqueue/Tests/Client/ConsumptionExtension/LogExtensionTest.php +++ b/pkg/enqueue/Tests/Client/ConsumptionExtension/LogExtensionTest.php @@ -91,7 +91,7 @@ public function testShouldLogMessageReceived() $logger ->expects($this->once()) ->method('debug') - ->with('Received from {queueName} {body}', [ + ->with('Received from {queueName}', [ 'queueName' => 'aQueue', 'redelivered' => false, 'body' => Stringify::that('aBody'), @@ -118,7 +118,7 @@ public function testShouldLogMessageProcessedWithStringResult() ->expects($this->once()) ->method('log') ->with(LogLevel::INFO, - 'Processed from {queueName} {body} {result}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), @@ -148,7 +148,7 @@ public function testShouldLogRejectedMessageAsError() ->expects($this->once()) ->method('log') ->with(LogLevel::ERROR, - 'Processed from {queueName} {body} {result}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), @@ -178,7 +178,7 @@ public function testShouldLogMessageProcessedWithResultObject() ->expects($this->once()) ->method('log') ->with(LogLevel::INFO, - 'Processed from {queueName} {body} {result}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), @@ -208,7 +208,7 @@ public function testShouldLogMessageProcessedWithReasonResultObject() ->expects($this->once()) ->method('log') ->with(LogLevel::INFO, - 'Processed from {queueName} {body} {result} {reason}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), diff --git a/pkg/enqueue/Tests/Consumption/Extension/LogExtensionTest.php b/pkg/enqueue/Tests/Consumption/Extension/LogExtensionTest.php index 006a2c549..01b29f0c0 100644 --- a/pkg/enqueue/Tests/Consumption/Extension/LogExtensionTest.php +++ b/pkg/enqueue/Tests/Consumption/Extension/LogExtensionTest.php @@ -85,7 +85,7 @@ public function testShouldLogMessageReceived() $logger ->expects($this->once()) ->method('debug') - ->with('Received from {queueName} {body}', [ + ->with('Received from {queueName}', [ 'queueName' => 'aQueue', 'redelivered' => false, 'body' => Stringify::that('aBody'), @@ -112,7 +112,7 @@ public function testShouldLogMessageProcessedWithStringResult() ->expects($this->once()) ->method('log') ->with(LogLevel::INFO, - 'Processed from {queueName} {body} {result}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), @@ -142,7 +142,7 @@ public function testShouldLogRejectedMessageAsError() ->expects($this->once()) ->method('log') ->with(LogLevel::ERROR, - 'Processed from {queueName} {body} {result}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), @@ -172,7 +172,7 @@ public function testShouldLogMessageProcessedWithResultObject() ->expects($this->once()) ->method('log') ->with(LogLevel::INFO, - 'Processed from {queueName} {body} {result}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), @@ -202,7 +202,7 @@ public function testShouldLogMessageProcessedWithReasonResultObject() ->expects($this->once()) ->method('log') ->with(LogLevel::INFO, - 'Processed from {queueName} {body} {result} {reason}', + 'Processed from {queueName}', [ 'queueName' => 'aQueue', 'body' => Stringify::that('aBody'), From db82ab68badb2c856ff2b175bba8d0899e30dae3 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 11:33:15 +0100 Subject: [PATCH 15/57] Add PHP 8.5 and Symfony 8 to CI --- .github/workflows/ci.yml | 40 ++++++++++++------- pkg/amqp-bunny/.github/workflows/ci.yml | 4 +- pkg/amqp-ext/.github/workflows/ci.yml | 4 +- pkg/amqp-lib/.github/workflows/ci.yml | 4 +- pkg/amqp-tools/.github/workflows/ci.yml | 4 +- pkg/async-command/.github/workflows/ci.yml | 4 +- .../.github/workflows/ci.yml | 4 +- pkg/dbal/.github/workflows/ci.yml | 4 +- pkg/dsn/.github/workflows/ci.yml | 4 +- pkg/enqueue-bundle/.github/workflows/ci.yml | 4 +- pkg/enqueue/.github/workflows/ci.yml | 4 +- pkg/fs/.github/workflows/ci.yml | 4 +- pkg/gearman/.github/workflows/ci.yml | 4 +- pkg/gps/.github/workflows/ci.yml | 4 +- pkg/job-queue/.github/workflows/ci.yml | 4 +- pkg/mongodb/.github/workflows/ci.yml | 4 +- pkg/monitoring/.github/workflows/ci.yml | 4 +- pkg/null/.github/workflows/ci.yml | 4 +- pkg/pheanstalk/.github/workflows/ci.yml | 4 +- pkg/rdkafka/.github/workflows/ci.yml | 4 +- pkg/redis/.github/workflows/ci.yml | 4 +- pkg/simple-client/.github/workflows/ci.yml | 2 +- pkg/sns/.github/workflows/ci.yml | 4 +- pkg/snsqs/.github/workflows/ci.yml | 4 +- pkg/sqs/.github/workflows/ci.yml | 4 +- pkg/stomp/.github/workflows/ci.yml | 4 +- pkg/wamp/.github/workflows/ci.yml | 4 +- 27 files changed, 77 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caff1b0c7..ef07e358d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: name: Static analysis runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: technote-space/get-diff-action@v6 with: @@ -23,7 +23,7 @@ jobs: extensions: mongodb, redis, :xdebug ini-values: memory_limit=2048M - - run: php ./bin/fix-symfony-version.php "5.4.*" + - run: php ./bin/fix-symfony-version.php "7.4.*" - uses: "ramsey/composer-install@v3" @@ -37,7 +37,7 @@ jobs: name: Code style check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: technote-space/get-diff-action@v6 with: @@ -77,17 +77,25 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2'] - symfony_version: ['6.2.*', '6.3.*', '6.4.*', '7.0.*'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] + symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - php: '8.1' - symfony_version: '7.0.*' + symfony_version: '7.3.*' + - php: '8.1' + symfony_version: '7.4.*' + - php: '8.1' + symfony_version: '8.0.*' + - php: '8.2' + symfony_version: '8.0.*' + - php: '8.3' + symfony_version: '8.0.*' name: PHP ${{ matrix.php }} unit tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get Composer Cache Directory id: composer-cache @@ -121,21 +129,25 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.1', '8.2' ] - symfony_version: [ '6.4.*', '7.0.*', '7.1.*', '7.2.*' ] - dependencies: [ '--prefer-lowest', '--prefer-dist' ] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] + symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] + dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - php: '8.1' - symfony_version: '7.0.*' + symfony_version: '7.3.*' - php: '8.1' - symfony_version: '7.1.*' + symfony_version: '7.4.*' - php: '8.1' - symfony_version: '7.2.*' + symfony_version: '8.0.*' + - php: '8.2' + symfony_version: '8.0.*' + - php: '8.3' + symfony_version: '8.0.*' name: PHP ${{ matrix.php }} functional tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Get Composer Cache Directory id: composer-cache diff --git a/pkg/amqp-bunny/.github/workflows/ci.yml b/pkg/amqp-bunny/.github/workflows/ci.yml index 5448d7b1a..cb2496813 100644 --- a/pkg/amqp-bunny/.github/workflows/ci.yml +++ b/pkg/amqp-bunny/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/amqp-ext/.github/workflows/ci.yml b/pkg/amqp-ext/.github/workflows/ci.yml index d48deb0af..16bb84a87 100644 --- a/pkg/amqp-ext/.github/workflows/ci.yml +++ b/pkg/amqp-ext/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/amqp-lib/.github/workflows/ci.yml b/pkg/amqp-lib/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/amqp-lib/.github/workflows/ci.yml +++ b/pkg/amqp-lib/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/amqp-tools/.github/workflows/ci.yml b/pkg/amqp-tools/.github/workflows/ci.yml index 5448d7b1a..cb2496813 100644 --- a/pkg/amqp-tools/.github/workflows/ci.yml +++ b/pkg/amqp-tools/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/async-command/.github/workflows/ci.yml b/pkg/async-command/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/async-command/.github/workflows/ci.yml +++ b/pkg/async-command/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/async-event-dispatcher/.github/workflows/ci.yml b/pkg/async-event-dispatcher/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/async-event-dispatcher/.github/workflows/ci.yml +++ b/pkg/async-event-dispatcher/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/dbal/.github/workflows/ci.yml b/pkg/dbal/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/dbal/.github/workflows/ci.yml +++ b/pkg/dbal/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/dsn/.github/workflows/ci.yml b/pkg/dsn/.github/workflows/ci.yml index 71bcbbd61..11567d7a6 100644 --- a/pkg/dsn/.github/workflows/ci.yml +++ b/pkg/dsn/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/enqueue-bundle/.github/workflows/ci.yml b/pkg/enqueue-bundle/.github/workflows/ci.yml index 4c397bef1..0dc4592d9 100644 --- a/pkg/enqueue-bundle/.github/workflows/ci.yml +++ b/pkg/enqueue-bundle/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/enqueue/.github/workflows/ci.yml b/pkg/enqueue/.github/workflows/ci.yml index 28a46e908..d533732a6 100644 --- a/pkg/enqueue/.github/workflows/ci.yml +++ b/pkg/enqueue/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/fs/.github/workflows/ci.yml b/pkg/fs/.github/workflows/ci.yml index 65cfbbb2d..1ebc0553d 100644 --- a/pkg/fs/.github/workflows/ci.yml +++ b/pkg/fs/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/gearman/.github/workflows/ci.yml b/pkg/gearman/.github/workflows/ci.yml index 28ae81b0f..c92f597a3 100644 --- a/pkg/gearman/.github/workflows/ci.yml +++ b/pkg/gearman/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/gps/.github/workflows/ci.yml b/pkg/gps/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/gps/.github/workflows/ci.yml +++ b/pkg/gps/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/job-queue/.github/workflows/ci.yml b/pkg/job-queue/.github/workflows/ci.yml index 28a9a9c02..736390c3a 100644 --- a/pkg/job-queue/.github/workflows/ci.yml +++ b/pkg/job-queue/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/mongodb/.github/workflows/ci.yml b/pkg/mongodb/.github/workflows/ci.yml index 415baf634..26f0ab81a 100644 --- a/pkg/mongodb/.github/workflows/ci.yml +++ b/pkg/mongodb/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/monitoring/.github/workflows/ci.yml b/pkg/monitoring/.github/workflows/ci.yml index 5448d7b1a..cb2496813 100644 --- a/pkg/monitoring/.github/workflows/ci.yml +++ b/pkg/monitoring/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/null/.github/workflows/ci.yml b/pkg/null/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/null/.github/workflows/ci.yml +++ b/pkg/null/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/pheanstalk/.github/workflows/ci.yml b/pkg/pheanstalk/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/pheanstalk/.github/workflows/ci.yml +++ b/pkg/pheanstalk/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/rdkafka/.github/workflows/ci.yml b/pkg/rdkafka/.github/workflows/ci.yml index 9e0ceb121..b36a960aa 100644 --- a/pkg/rdkafka/.github/workflows/ci.yml +++ b/pkg/rdkafka/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/redis/.github/workflows/ci.yml b/pkg/redis/.github/workflows/ci.yml index 57d501bee..eccb7baed 100644 --- a/pkg/redis/.github/workflows/ci.yml +++ b/pkg/redis/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/simple-client/.github/workflows/ci.yml b/pkg/simple-client/.github/workflows/ci.yml index 604442a2f..da80afd96 100644 --- a/pkg/simple-client/.github/workflows/ci.yml +++ b/pkg/simple-client/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/sns/.github/workflows/ci.yml b/pkg/sns/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/sns/.github/workflows/ci.yml +++ b/pkg/sns/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/snsqs/.github/workflows/ci.yml b/pkg/snsqs/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/snsqs/.github/workflows/ci.yml +++ b/pkg/snsqs/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/sqs/.github/workflows/ci.yml b/pkg/sqs/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/sqs/.github/workflows/ci.yml +++ b/pkg/sqs/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/stomp/.github/workflows/ci.yml b/pkg/stomp/.github/workflows/ci.yml index 0492424e8..ee354264b 100644 --- a/pkg/stomp/.github/workflows/ci.yml +++ b/pkg/stomp/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: diff --git a/pkg/wamp/.github/workflows/ci.yml b/pkg/wamp/.github/workflows/ci.yml index 5448d7b1a..cb2496813 100644 --- a/pkg/wamp/.github/workflows/ci.yml +++ b/pkg/wamp/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: From d5afeff496be20ed81ed1d66bf5800414035292e Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 13:30:12 +0100 Subject: [PATCH 16/57] Bump symfony versions in pkgs; test with ORM 3.6.x --- composer.json | 26 +++++++++++++------------- pkg/async-command/composer.json | 16 ++++++++-------- pkg/job-queue/composer.json | 8 ++++---- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index 75ff4424a..661102fff 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "psr/container": "^1.1 || ^2.0", "makasim/temp-file": "^0.2", "google/cloud-pubsub": "^1.46", - "doctrine/orm": "^2.12", + "doctrine/orm": "3.6.x-dev", "doctrine/persistence": "^2.0|^3.0", "mongodb/mongodb": "^1.17", "pda/pheanstalk": "^3.1", @@ -53,18 +53,18 @@ "phpunit/phpunit": "^9.5.28", "phpstan/phpstan": "^1.0", "queue-interop/queue-spec": "^0.6.2", - "symfony/browser-kit": "^6.2|^7.0", - "symfony/config": "^6.2|^7.0", - "symfony/process": "^6.2|^7.0", - "symfony/console": "^6.2|^7.0", - "symfony/dependency-injection": "^6.2|^7.0", - "symfony/event-dispatcher": "^6.2|^7.0", - "symfony/expression-language": "^6.2|^7.0", - "symfony/http-kernel": "^6.2|^7.0", - "symfony/filesystem": "^6.2|^7.0", - "symfony/framework-bundle": "^6.2|^7.0", - "symfony/validator": "^6.2|^7.0", - "symfony/yaml": "^6.2|^7.0", + "symfony/browser-kit": "^6.2|^7.0|^8.0", + "symfony/config": "^6.2|^7.0|^8.0", + "symfony/process": "^6.2|^7.0|^8.0", + "symfony/console": "^6.2|^7.0|^8.0", + "symfony/dependency-injection": "^6.2|^7.0|^8.0", + "symfony/event-dispatcher": "^6.2|^7.0|^8.0", + "symfony/expression-language": "^6.2|^7.0|^8.0", + "symfony/http-kernel": "^6.2|^7.0|^8.0", + "symfony/filesystem": "^6.2|^7.0|^8.0", + "symfony/framework-bundle": "^6.2|^7.0|^8.0", + "symfony/validator": "^6.2|^7.0|^8.0", + "symfony/yaml": "^6.2|^7.0|^8.0", "empi89/php-amqp-stubs": "*@dev", "doctrine/doctrine-bundle": "^2.5", "doctrine/mongodb-odm-bundle": "^4.7|^5.0", diff --git a/pkg/async-command/composer.json b/pkg/async-command/composer.json index 95d57ce3a..4fe65d7a7 100644 --- a/pkg/async-command/composer.json +++ b/pkg/async-command/composer.json @@ -9,16 +9,16 @@ "php": "^8.1", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", - "symfony/console": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0" + "symfony/console": "^6.2|^7.0|^8.0", + "symfony/process": "^6.2|^7.0|^8.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": "^6.2|^7.0|^8.0", + "symfony/config": "^6.2|^7.0|^8.0", + "symfony/http-kernel": "^6.2|^7.0|^8.0", + "symfony/filesystem": "^6.2|^7.0|^8.0", + "symfony/yaml": "^6.2|^7.0|^8.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": "^6.2|^7.0|^8.0 If you'd like to use async event dispatcher container extension." }, "autoload": { "psr-4": { "Enqueue\\AsyncCommand\\": "" }, diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index 6616069b3..d899d80ce 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": "^6.2|^7.0|^8.0", + "symfony/expression-language": "^6.2|^7.0|^8.0", + "symfony/framework-bundle": "^6.2|^7.0|^8.0", + "symfony/yaml": "^6.2|^7.0|^8.0" }, "support": { "email": "opensource@forma-pro.com", From c6d4016b3ff7c9cf8e33daff8524199c0606ad7e Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 13:50:55 +0100 Subject: [PATCH 17/57] Replace the removed method --- pkg/job-queue/Doctrine/JobStorage.php | 2 +- pkg/job-queue/Tests/Doctrine/JobStorageTest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/job-queue/Doctrine/JobStorage.php b/pkg/job-queue/Doctrine/JobStorage.php index 4db585696..a68cc52b3 100644 --- a/pkg/job-queue/Doctrine/JobStorage.php +++ b/pkg/job-queue/Doctrine/JobStorage.php @@ -136,7 +136,7 @@ public function saveJob(Job $job, ?\Closure $lockCallback = null) throw new \LogicException('Is not possible to create new job with lock, only update is allowed'); } - $this->getEntityManager()->transactional(function (EntityManager $em) use ($job, $lockCallback) { + $this->getEntityManager()->wrapInTransaction(function (EntityManager $em) use ($job, $lockCallback) { /** @var Job $job */ $job = $this->getEntityRepository()->find($job->getId(), LockMode::PESSIMISTIC_WRITE); diff --git a/pkg/job-queue/Tests/Doctrine/JobStorageTest.php b/pkg/job-queue/Tests/Doctrine/JobStorageTest.php index 73f130d52..e86d0d601 100644 --- a/pkg/job-queue/Tests/Doctrine/JobStorageTest.php +++ b/pkg/job-queue/Tests/Doctrine/JobStorageTest.php @@ -170,7 +170,7 @@ public function testShouldSaveJobWithoutLockIfThereIsNoCallbackAndChildJob() ; $em ->expects($this->never()) - ->method('transactional') + ->method('wrapInTransaction') ; $em ->expects($this->any()) @@ -224,7 +224,7 @@ public function testShouldSaveJobWithLockIfWithCallback() ; $em ->expects($this->once()) - ->method('transactional') + ->method('wrapInTransaction') ; $em ->expects($this->any()) @@ -387,7 +387,7 @@ public function testShouldLockEntityAndPassNewInstanceIntoCallback() ; $em ->expects($this->once()) - ->method('transactional') + ->method('wrapInTransaction') ->willReturnCallback(function ($callback) use ($em) { $callback($em); }) @@ -536,7 +536,7 @@ public function testShouldDeleteRecordFromUniqueTableIfJobIsUniqueAndStoppedAtIs ; $em ->expects($this->once()) - ->method('transactional') + ->method('wrapInTransaction') ->willReturnCallback(function ($callback) use ($em) { $callback($em); }) From 147a5e38553f31db8ecf58567fe6afa727381c43 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:00:56 +0100 Subject: [PATCH 18/57] Allow newer doctrine package versions --- composer.json | 8 ++++---- pkg/dbal/composer.json | 4 ++-- pkg/enqueue-bundle/composer.json | 2 +- pkg/job-queue/composer.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 661102fff..d5f2c0e44 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ "queue-interop/queue-interop": "^0.8.1", "bunny/bunny": "^0.5.5", "php-amqplib/php-amqplib": "^3.1", - "doctrine/dbal": "^3.2", + "doctrine/dbal": "^3.2|^4.0", "ramsey/uuid": "^4.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "psr/container": "^1.1 || ^2.0", "makasim/temp-file": "^0.2", "google/cloud-pubsub": "^1.46", "doctrine/orm": "3.6.x-dev", - "doctrine/persistence": "^2.0|^3.0", + "doctrine/persistence": "^2.0|^3.0|^4.0", "mongodb/mongodb": "^1.17", "pda/pheanstalk": "^3.1", "aws/aws-sdk-php": "^3.290", @@ -66,7 +66,7 @@ "symfony/validator": "^6.2|^7.0|^8.0", "symfony/yaml": "^6.2|^7.0|^8.0", "empi89/php-amqp-stubs": "*@dev", - "doctrine/doctrine-bundle": "^2.5", + "doctrine/doctrine-bundle": "^2.5|^3.1", "doctrine/mongodb-odm-bundle": "^4.7|^5.0", "alcaeus/mongo-php-adapter": "^1.0", "kwn/php-rdkafka-stubs": "^2.0.3", @@ -127,7 +127,7 @@ "ext-rdkafka": "4.0", "ext-bcmath": "1", "ext-mbstring": "1", - "ext-mongodb": "1.17.3", + "ext-mongodb": "1.21", "ext-sockets": "1" }, "prefer-stable": true, diff --git a/pkg/dbal/composer.json b/pkg/dbal/composer.json index 9499d394d..adc0b6c44 100644 --- a/pkg/dbal/composer.json +++ b/pkg/dbal/composer.json @@ -8,8 +8,8 @@ "require": { "php": "^8.1", "queue-interop/queue-interop": "^0.8", - "doctrine/dbal": "^2.12|^3.1", - "doctrine/persistence": "^2.0|^3.0", + "doctrine/dbal": "^3.2|^4.0", + "doctrine/persistence": "^2.0|^3.0|^4.0", "ramsey/uuid": "^3.5|^4" }, "require-dev": { diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index 99d237bf6..6c5638c43 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -36,7 +36,7 @@ "enqueue/async-event-dispatcher": "0.10.x-dev", "enqueue/async-command": "0.10.x-dev", "php-amqplib/php-amqplib": "^3.0", - "doctrine/doctrine-bundle": "^2.3.2", + "doctrine/doctrine-bundle": "^2.5|^3.1", "doctrine/mongodb-odm-bundle": "^3.5|^4.3|^5.0", "alcaeus/mongo-php-adapter": "^1.0", "symfony/browser-kit": "^6.2|^7.0", diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index d899d80ce..fec589eeb 100644 --- a/pkg/job-queue/composer.json +++ b/pkg/job-queue/composer.json @@ -11,12 +11,12 @@ "enqueue/null": "^0.10", "queue-interop/queue-interop": "^0.8", "doctrine/orm": "^2.12", - "doctrine/dbal": "^2.12 | ^3.0" + "doctrine/dbal": "^3.2|^4.0" }, "require-dev": { "phpunit/phpunit": "^9.5", "enqueue/test": "0.10.x-dev", - "doctrine/doctrine-bundle": "^2.3.2", + "doctrine/doctrine-bundle": "^2.5|^3.1", "symfony/browser-kit": "^6.2|^7.0|^8.0", "symfony/expression-language": "^6.2|^7.0|^8.0", "symfony/framework-bundle": "^6.2|^7.0|^8.0", From 17c7185047021fb0ff8f041b4aa3d5006d512b78 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:05:22 +0100 Subject: [PATCH 19/57] Fix function signature --- .../Tests/Symfony/Client/Mock/SetupBrokerExtensionCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/enqueue/Tests/Symfony/Client/Mock/SetupBrokerExtensionCommand.php b/pkg/enqueue/Tests/Symfony/Client/Mock/SetupBrokerExtensionCommand.php index c21750592..a4978eaf6 100644 --- a/pkg/enqueue/Tests/Symfony/Client/Mock/SetupBrokerExtensionCommand.php +++ b/pkg/enqueue/Tests/Symfony/Client/Mock/SetupBrokerExtensionCommand.php @@ -22,7 +22,7 @@ public function getExtension() return $this->extension; } - protected function configure() + protected function configure(): void { parent::configure(); From f4ab0d68b2c5ec14b7a2e1ae721d89cbfad07907 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:23:31 +0100 Subject: [PATCH 20/57] Work around the removal of Connection::connect() --- pkg/dbal/DbalConnectionFactory.php | 2 +- pkg/dbal/ManagerRegistryConnectionFactory.php | 3 ++- .../DoctrinePingConnectionExtension.php | 2 +- .../DoctrinePingConnectionExtensionTest.php | 4 ++-- pkg/job-queue/Test/DbalPersistedConnection.php | 18 ++++++------------ 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index 305375a89..c6f10d7a2 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -86,7 +86,7 @@ private function establishConnection(): Connection { if (false == $this->connection) { $this->connection = DriverManager::getConnection($this->config['connection']); - $this->connection->connect(); + $this->connection->getServerVersion(); // calls connect() internally } return $this->connection; diff --git a/pkg/dbal/ManagerRegistryConnectionFactory.php b/pkg/dbal/ManagerRegistryConnectionFactory.php index 430633151..9b24250c7 100644 --- a/pkg/dbal/ManagerRegistryConnectionFactory.php +++ b/pkg/dbal/ManagerRegistryConnectionFactory.php @@ -59,8 +59,9 @@ public function close(): void private function establishConnection(): Connection { + /** @var Connection $connection */ $connection = $this->registry->getConnection($this->config['connection_name']); - $connection->connect(); + $connection->getServerVersion(); // calls connect() internally return $connection; } diff --git a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php index 7fd9527db..81fccdd04 100644 --- a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php +++ b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php @@ -36,7 +36,7 @@ public function onMessageReceived(MessageReceived $context): void ); $connection->close(); - $connection->connect(); + $connection->getServerVersion(); // calls connect() internally $context->getLogger()->debug( '[DoctrinePingConnectionExtension] Connection is active now.' diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php index 36df82e52..e1e03850a 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php @@ -43,7 +43,7 @@ public function testShouldNotReconnectIfConnectionIsOK() ; $connection ->expects($this->never()) - ->method('connect') + ->method('getServerVersion') ; $context = $this->createContext(); @@ -83,7 +83,7 @@ public function testShouldDoesReconnectIfConnectionFailed() ; $connection ->expects($this->once()) - ->method('connect') + ->method('getServerVersion') ; $context = $this->createContext(); diff --git a/pkg/job-queue/Test/DbalPersistedConnection.php b/pkg/job-queue/Test/DbalPersistedConnection.php index 470a65176..512096acb 100644 --- a/pkg/job-queue/Test/DbalPersistedConnection.php +++ b/pkg/job-queue/Test/DbalPersistedConnection.php @@ -22,10 +22,10 @@ class DbalPersistedConnection extends Connection */ protected static $persistedTransactionNestingLevels; - public function connect() + public function connect(): DriverConnection { if ($this->isConnected()) { - return false; + return $this->_conn; } if ($this->hasPersistedConnection()) { @@ -35,28 +35,22 @@ public function connect() $this->persistConnection($this->_conn); } - return true; + return $this->_conn; } - public function beginTransaction() + public function beginTransaction(): void { $this->wrapTransactionNestingLevel('beginTransaction'); - - return true; } - public function commit() + public function commit(): void { $this->wrapTransactionNestingLevel('commit'); - - return true; } - public function rollBack() + public function rollBack(): void { $this->wrapTransactionNestingLevel('rollBack'); - - return true; } /** From b9e575034ed48177cfab7a5926b289e5aa6d53d2 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:33:49 +0100 Subject: [PATCH 21/57] Juggle connect()/getServerVersion() --- pkg/dbal/ManagerRegistryConnectionFactory.php | 8 +++++- .../DoctrinePingConnectionExtension.php | 8 +++++- .../DoctrinePingConnectionExtensionTest.php | 27 +++++++++++++------ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/pkg/dbal/ManagerRegistryConnectionFactory.php b/pkg/dbal/ManagerRegistryConnectionFactory.php index 9b24250c7..1da6a9bfb 100644 --- a/pkg/dbal/ManagerRegistryConnectionFactory.php +++ b/pkg/dbal/ManagerRegistryConnectionFactory.php @@ -61,7 +61,13 @@ private function establishConnection(): Connection { /** @var Connection $connection */ $connection = $this->registry->getConnection($this->config['connection_name']); - $connection->getServerVersion(); // calls connect() internally + if (method_exists($connection, 'connect')) { + // DBAL < 4 + $connection->connect(); + } else { + // DBAL >= 4, calls connect() internally + $connection->getServerVersion(); + } return $connection; } diff --git a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php index 81fccdd04..c82967334 100644 --- a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php +++ b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php @@ -36,7 +36,13 @@ public function onMessageReceived(MessageReceived $context): void ); $connection->close(); - $connection->getServerVersion(); // calls connect() internally + if (method_exists($connection, 'connect')) { + // DBAL < 4 + $connection->connect(); + } else { + // DBAL >= 4, calls connect() internally + $connection->getServerVersion(); + } $context->getLogger()->debug( '[DoctrinePingConnectionExtension] Connection is active now.' diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php index e1e03850a..1e3340512 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php @@ -41,10 +41,16 @@ public function testShouldNotReconnectIfConnectionIsOK() ->expects($this->never()) ->method('close') ; - $connection - ->expects($this->never()) - ->method('getServerVersion') - ; + if (method_exists($connection, 'connect')) { + // DBAL < 4 + $connection->expects($this->never()) + ->method('connect'); + } else { + // DBAL >= 4, calls connect() internally + $connection + ->expects($this->never()) + ->method('getServerVersion'); + } $context = $this->createContext(); @@ -81,10 +87,15 @@ public function testShouldDoesReconnectIfConnectionFailed() ->expects($this->once()) ->method('close') ; - $connection - ->expects($this->once()) - ->method('getServerVersion') - ; + if (method_exists($connection, 'connect')) { + // DBAL < 4 + $connection->expects($this->once()) + ->method('connect'); + } else { + // DBAL >= 4, calls connect() internally + $connection->expects($this->once()) + ->method('getServerVersion'); + } $context = $this->createContext(); From 7ff8cb819cb4317dde0963156909c8187bc4a38d Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:37:03 +0100 Subject: [PATCH 22/57] Fix the method detection --- .../Extension/DoctrinePingConnectionExtensionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php index 1e3340512..c0ae5f1c0 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php @@ -41,7 +41,7 @@ public function testShouldNotReconnectIfConnectionIsOK() ->expects($this->never()) ->method('close') ; - if (method_exists($connection, 'connect')) { + if (method_exists(Connection::class, 'connect')) { // DBAL < 4 $connection->expects($this->never()) ->method('connect'); @@ -87,7 +87,7 @@ public function testShouldDoesReconnectIfConnectionFailed() ->expects($this->once()) ->method('close') ; - if (method_exists($connection, 'connect')) { + if (method_exists(Connection::class, 'connect')) { // DBAL < 4 $connection->expects($this->once()) ->method('connect'); From 65c7385df0af0b004ee1c1b443c30d5d2334e8e1 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:49:10 +0100 Subject: [PATCH 23/57] Fix the method visibility check --- pkg/dbal/ManagerRegistryConnectionFactory.php | 6 +++++- .../Extension/DoctrinePingConnectionExtension.php | 6 +++++- .../Extension/DoctrinePingConnectionExtensionTest.php | 11 +++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pkg/dbal/ManagerRegistryConnectionFactory.php b/pkg/dbal/ManagerRegistryConnectionFactory.php index 1da6a9bfb..dc4415c6c 100644 --- a/pkg/dbal/ManagerRegistryConnectionFactory.php +++ b/pkg/dbal/ManagerRegistryConnectionFactory.php @@ -8,6 +8,7 @@ use Doctrine\Persistence\ManagerRegistry; use Interop\Queue\ConnectionFactory; use Interop\Queue\Context; +use ReflectionMethod; class ManagerRegistryConnectionFactory implements ConnectionFactory { @@ -61,7 +62,10 @@ private function establishConnection(): Connection { /** @var Connection $connection */ $connection = $this->registry->getConnection($this->config['connection_name']); - if (method_exists($connection, 'connect')) { + if ( + method_exists($connection, 'connect') + && (new ReflectionMethod($connection, 'connect'))->isPublic() + ) { // DBAL < 4 $connection->connect(); } else { diff --git a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php index c82967334..75442cba0 100644 --- a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php +++ b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php @@ -6,6 +6,7 @@ use Doctrine\Persistence\ManagerRegistry; use Enqueue\Consumption\Context\MessageReceived; use Enqueue\Consumption\MessageReceivedExtensionInterface; +use ReflectionMethod; class DoctrinePingConnectionExtension implements MessageReceivedExtensionInterface { @@ -36,7 +37,10 @@ public function onMessageReceived(MessageReceived $context): void ); $connection->close(); - if (method_exists($connection, 'connect')) { + if ( + method_exists($connection, 'connect') + && (new ReflectionMethod($connection, 'connect'))->isPublic() + ) { // DBAL < 4 $connection->connect(); } else { diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php index c0ae5f1c0..898658a5a 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php @@ -14,6 +14,7 @@ use Interop\Queue\Processor; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use ReflectionMethod; class DoctrinePingConnectionExtensionTest extends TestCase { @@ -41,7 +42,10 @@ public function testShouldNotReconnectIfConnectionIsOK() ->expects($this->never()) ->method('close') ; - if (method_exists(Connection::class, 'connect')) { + if ( + method_exists(Connection::class, 'connect') + && (new ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { // DBAL < 4 $connection->expects($this->never()) ->method('connect'); @@ -87,7 +91,10 @@ public function testShouldDoesReconnectIfConnectionFailed() ->expects($this->once()) ->method('close') ; - if (method_exists(Connection::class, 'connect')) { + if ( + method_exists(Connection::class, 'connect') + && (new ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { // DBAL < 4 $connection->expects($this->once()) ->method('connect'); From 09bbbd651bb942fa5c8425cd222f981e2f5286fe Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 14:55:19 +0100 Subject: [PATCH 24/57] Fix CS --- pkg/dbal/ManagerRegistryConnectionFactory.php | 3 +-- .../Extension/DoctrinePingConnectionExtension.php | 3 +-- .../Extension/DoctrinePingConnectionExtensionTest.php | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/dbal/ManagerRegistryConnectionFactory.php b/pkg/dbal/ManagerRegistryConnectionFactory.php index dc4415c6c..602a76762 100644 --- a/pkg/dbal/ManagerRegistryConnectionFactory.php +++ b/pkg/dbal/ManagerRegistryConnectionFactory.php @@ -8,7 +8,6 @@ use Doctrine\Persistence\ManagerRegistry; use Interop\Queue\ConnectionFactory; use Interop\Queue\Context; -use ReflectionMethod; class ManagerRegistryConnectionFactory implements ConnectionFactory { @@ -64,7 +63,7 @@ private function establishConnection(): Connection $connection = $this->registry->getConnection($this->config['connection_name']); if ( method_exists($connection, 'connect') - && (new ReflectionMethod($connection, 'connect'))->isPublic() + && (new \ReflectionMethod($connection, 'connect'))->isPublic() ) { // DBAL < 4 $connection->connect(); diff --git a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php index 75442cba0..a33739870 100644 --- a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php +++ b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php @@ -6,7 +6,6 @@ use Doctrine\Persistence\ManagerRegistry; use Enqueue\Consumption\Context\MessageReceived; use Enqueue\Consumption\MessageReceivedExtensionInterface; -use ReflectionMethod; class DoctrinePingConnectionExtension implements MessageReceivedExtensionInterface { @@ -39,7 +38,7 @@ public function onMessageReceived(MessageReceived $context): void $connection->close(); if ( method_exists($connection, 'connect') - && (new ReflectionMethod($connection, 'connect'))->isPublic() + && (new \ReflectionMethod($connection, 'connect'))->isPublic() ) { // DBAL < 4 $connection->connect(); diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php index 898658a5a..b690fa290 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php @@ -14,7 +14,6 @@ use Interop\Queue\Processor; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use ReflectionMethod; class DoctrinePingConnectionExtensionTest extends TestCase { @@ -44,7 +43,7 @@ public function testShouldNotReconnectIfConnectionIsOK() ; if ( method_exists(Connection::class, 'connect') - && (new ReflectionMethod(Connection::class, 'connect'))->isPublic() + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() ) { // DBAL < 4 $connection->expects($this->never()) @@ -93,7 +92,7 @@ public function testShouldDoesReconnectIfConnectionFailed() ; if ( method_exists(Connection::class, 'connect') - && (new ReflectionMethod(Connection::class, 'connect'))->isPublic() + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() ) { // DBAL < 4 $connection->expects($this->once()) From 5d49067572acccff06b8b7f9173f12d4a433276c Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 15:00:33 +0100 Subject: [PATCH 25/57] Fix more signatures --- .../Tests/Symfony/Consumption/Mock/LimitsExtensionsCommand.php | 2 +- .../Symfony/Consumption/Mock/QueueConsumerOptionsCommand.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/enqueue/Tests/Symfony/Consumption/Mock/LimitsExtensionsCommand.php b/pkg/enqueue/Tests/Symfony/Consumption/Mock/LimitsExtensionsCommand.php index 05e0c56ba..b15fe82fd 100644 --- a/pkg/enqueue/Tests/Symfony/Consumption/Mock/LimitsExtensionsCommand.php +++ b/pkg/enqueue/Tests/Symfony/Consumption/Mock/LimitsExtensionsCommand.php @@ -18,7 +18,7 @@ public function getExtensions() return $this->extensions; } - protected function configure() + protected function configure(): void { parent::configure(); diff --git a/pkg/enqueue/Tests/Symfony/Consumption/Mock/QueueConsumerOptionsCommand.php b/pkg/enqueue/Tests/Symfony/Consumption/Mock/QueueConsumerOptionsCommand.php index 147a3b905..55aa0ab48 100644 --- a/pkg/enqueue/Tests/Symfony/Consumption/Mock/QueueConsumerOptionsCommand.php +++ b/pkg/enqueue/Tests/Symfony/Consumption/Mock/QueueConsumerOptionsCommand.php @@ -24,7 +24,7 @@ public function __construct(QueueConsumerInterface $consumer) $this->consumer = $consumer; } - protected function configure() + protected function configure(): void { parent::configure(); From 3055292f611a45f660e4e5eb5497623bc0bb24b0 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 15:06:01 +0100 Subject: [PATCH 26/57] Fix more signatures --- pkg/async-command/DependencyInjection/AsyncCommandExtension.php | 2 +- .../DependencyInjection/AsyncEventDispatcherExtension.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/async-command/DependencyInjection/AsyncCommandExtension.php b/pkg/async-command/DependencyInjection/AsyncCommandExtension.php index c1a0fa8f8..f1517e31f 100644 --- a/pkg/async-command/DependencyInjection/AsyncCommandExtension.php +++ b/pkg/async-command/DependencyInjection/AsyncCommandExtension.php @@ -9,7 +9,7 @@ class AsyncCommandExtension extends Extension { - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { foreach ($configs['clients'] as $client) { // BC compatibility diff --git a/pkg/async-event-dispatcher/DependencyInjection/AsyncEventDispatcherExtension.php b/pkg/async-event-dispatcher/DependencyInjection/AsyncEventDispatcherExtension.php index 0b16ca650..947abd70b 100644 --- a/pkg/async-event-dispatcher/DependencyInjection/AsyncEventDispatcherExtension.php +++ b/pkg/async-event-dispatcher/DependencyInjection/AsyncEventDispatcherExtension.php @@ -13,7 +13,7 @@ class AsyncEventDispatcherExtension extends Extension { - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $config = $this->processConfiguration(new Configuration(), $configs); From 40de666f81455b954ff8e8a23c9f06c8d391f5d1 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 15:12:07 +0100 Subject: [PATCH 27/57] Don't mock resetter impl --- .../Consumption/Extension/ResetServicesExtension.php | 10 ++-------- .../Extension/ResetServicesExtensionTest.php | 6 ++++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pkg/enqueue-bundle/Consumption/Extension/ResetServicesExtension.php b/pkg/enqueue-bundle/Consumption/Extension/ResetServicesExtension.php index 0bf642197..05c79bd57 100644 --- a/pkg/enqueue-bundle/Consumption/Extension/ResetServicesExtension.php +++ b/pkg/enqueue-bundle/Consumption/Extension/ResetServicesExtension.php @@ -4,18 +4,12 @@ use Enqueue\Consumption\Context\PostMessageReceived; use Enqueue\Consumption\PostMessageReceivedExtensionInterface; -use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter; +use Symfony\Contracts\Service\ResetInterface; class ResetServicesExtension implements PostMessageReceivedExtensionInterface { - /** - * @var ServicesResetter - */ - private $resetter; - - public function __construct(ServicesResetter $resetter) + public function __construct(private ResetInterface $resetter) { - $this->resetter = $resetter; } public function onPostMessageReceived(PostMessageReceived $context): void diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php index 63282a255..e965fb6db 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php @@ -13,6 +13,8 @@ use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter; +use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetterInterface; +use Symfony\Contracts\Service\ResetInterface; class ResetServicesExtensionTest extends TestCase { @@ -50,8 +52,8 @@ protected function createContext(): PostMessageReceived /** * @return MockObject|ManagerRegistry */ - protected function createResetterMock(): ServicesResetter + protected function createResetterMock(): ResetInterface { - return $this->createMock(ServicesResetter::class); + return $this->createMock(ResetInterface::class); } } From 7d924f3e674b5ebccf89e40e54fd5857308c2c09 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 15:13:59 +0100 Subject: [PATCH 28/57] Fix CS --- .../Unit/Consumption/Extension/ResetServicesExtensionTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php index e965fb6db..e0d96fafa 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php @@ -12,8 +12,6 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter; -use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetterInterface; use Symfony\Contracts\Service\ResetInterface; class ResetServicesExtensionTest extends TestCase From 0bb43bbff8af582efb61da5a838ecd467b04a335 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 15:43:56 +0100 Subject: [PATCH 29/57] Fix the pdo driver indication; one more place with connect() --- docker-compose.yml | 2 +- pkg/dbal/DbalConnectionFactory.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b724d7881..0489e1cc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - STOMP_DSN=stomp://guest:guest@rabbitmq:61613/mqdev - RABITMQ_STOMP_DSN=stomp+rabbitmq://guest:guest@rabbitmq:61613/mqdev - RABBITMQ_MANAGMENT_DSN=http://guest:guest@rabbitmq:15672/mqdev - - DOCTRINE_DSN=mysql://root:rootpass@mysql/mqdev + - DOCTRINE_DSN=pdo_mysql://root:rootpass@mysql/mqdev - DOCTRINE_POSTGRES_DSN=postgres://postgres:pass@postgres/template1 - MYSQL_DSN=mysql://root:rootpass@mysql/mqdev - POSTGRES_DSN=postgres://postgres:pass@postgres/postgres diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index c6f10d7a2..aa0fe135e 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -86,7 +86,16 @@ private function establishConnection(): Connection { if (false == $this->connection) { $this->connection = DriverManager::getConnection($this->config['connection']); - $this->connection->getServerVersion(); // calls connect() internally + if ( + method_exists($this->connection, 'connect') + && (new \ReflectionMethod($this->connection, 'connect'))->isPublic() + ) { + // DBAL < 4 + $this->connection->connect(); + } else { + // DBAL >= 4 + $this->connection->getServerVersion(); // calls connect() internally + } } return $this->connection; From 4316bf4a3a0b25f032eb3e31ef4a2c72b3cab416 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 15:53:31 +0100 Subject: [PATCH 30/57] Better pdo driver string? --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0489e1cc3..c551f8e71 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - STOMP_DSN=stomp://guest:guest@rabbitmq:61613/mqdev - RABITMQ_STOMP_DSN=stomp+rabbitmq://guest:guest@rabbitmq:61613/mqdev - RABBITMQ_MANAGMENT_DSN=http://guest:guest@rabbitmq:15672/mqdev - - DOCTRINE_DSN=pdo_mysql://root:rootpass@mysql/mqdev + - DOCTRINE_DSN=mysql+pdo://root:rootpass@mysql/mqdev - DOCTRINE_POSTGRES_DSN=postgres://postgres:pass@postgres/template1 - MYSQL_DSN=mysql://root:rootpass@mysql/mqdev - POSTGRES_DSN=postgres://postgres:pass@postgres/postgres From a11a200d54c0273fa9192ab284c007e41fe020a5 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Mon, 1 Dec 2025 14:20:53 +0200 Subject: [PATCH 31/57] Drop PHP 8.5 from CI --- .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 ef07e358d..b6f668b96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.1', '8.2', '8.3', '8.4'] symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: From 6a482c46671ead3adee801d1a875053175024635 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Mon, 1 Dec 2025 16:24:40 +0200 Subject: [PATCH 32/57] Drop SF5 from tests --- .../Tests/Functional/App/AppKernel.php | 8 +- .../Tests/Functional/App/CustomAppKernel.php | 9 +- .../Functional/App/config/config-sf5.yml | 129 ------------------ .../App/config/custom-config-sf5.yml | 85 ------------ .../Tests/Functional/app/AppKernel.php | 8 +- .../Functional/app/config/config-sf5.yml | 33 ----- 6 files changed, 4 insertions(+), 268 deletions(-) delete mode 100644 pkg/enqueue-bundle/Tests/Functional/App/config/config-sf5.yml delete mode 100644 pkg/enqueue-bundle/Tests/Functional/App/config/custom-config-sf5.yml delete mode 100644 pkg/job-queue/Tests/Functional/app/config/config-sf5.yml diff --git a/pkg/enqueue-bundle/Tests/Functional/App/AppKernel.php b/pkg/enqueue-bundle/Tests/Functional/App/AppKernel.php index 3cafeedda..5ec2e75cd 100644 --- a/pkg/enqueue-bundle/Tests/Functional/App/AppKernel.php +++ b/pkg/enqueue-bundle/Tests/Functional/App/AppKernel.php @@ -28,14 +28,8 @@ public function getLogDir(): string return sys_get_temp_dir().'/EnqueueBundle/cache/logs'; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { - if (self::VERSION_ID < 60000) { - $loader->load(__DIR__.'/config/config-sf5.yml'); - - return; - } - $loader->load(__DIR__.'/config/config.yml'); } diff --git a/pkg/enqueue-bundle/Tests/Functional/App/CustomAppKernel.php b/pkg/enqueue-bundle/Tests/Functional/App/CustomAppKernel.php index 81d73796e..5009adc69 100644 --- a/pkg/enqueue-bundle/Tests/Functional/App/CustomAppKernel.php +++ b/pkg/enqueue-bundle/Tests/Functional/App/CustomAppKernel.php @@ -64,14 +64,9 @@ protected function getContainerClass(): string return parent::getContainerClass().'Custom'.$this->enqueueConfigId; } - protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) + protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader): void { - if (self::VERSION_ID < 60000) { - $loader->load(__DIR__.'/config/custom-config-sf5.yml'); - } else { - $loader->load(__DIR__.'/config/custom-config.yml'); - } - + $loader->load(__DIR__.'/config/custom-config.yml'); $c->loadFromExtension('enqueue', $this->enqueueConfig); } diff --git a/pkg/enqueue-bundle/Tests/Functional/App/config/config-sf5.yml b/pkg/enqueue-bundle/Tests/Functional/App/config/config-sf5.yml deleted file mode 100644 index e202bb86f..000000000 --- a/pkg/enqueue-bundle/Tests/Functional/App/config/config-sf5.yml +++ /dev/null @@ -1,129 +0,0 @@ -parameters: - locale: 'en' - secret: 'ThisTokenIsNotSoSecretChangeIt' - - -framework: - #esi: ~ - #translator: { fallback: "%locale%" } - test: ~ - assets: false - session: - # option incompatible with Symfony 6 - storage_id: session.storage.mock_file - secret: '%secret%' - router: { resource: '%kernel.project_dir%/config/routing.yml' } - default_locale: '%locale%' - -doctrine: - dbal: - url: "%env(DOCTRINE_DSN)%" - driver: pdo_mysql - charset: UTF8 - -enqueue: - default: - transport: 'null:' - client: - traceable_producer: true - job: true - async_events: true - async_commands: - enabled: true - timeout: 60 - command_name: ~ - queue_name: ~ - -services: - test_enqueue.client.default.traceable_producer: - alias: 'enqueue.client.default.traceable_producer' - public: true - - test_enqueue.transport.default.queue_consumer: - alias: 'enqueue.transport.default.queue_consumer' - public: true - - test_enqueue.client.default.queue_consumer: - alias: 'enqueue.client.default.queue_consumer' - public: true - - test_enqueue.transport.default.rpc_client: - alias: 'enqueue.transport.default.rpc_client' - public: true - - test_enqueue.client.default.producer: - alias: 'enqueue.client.default.producer' - public: true - - test_enqueue.client.default.spool_producer: - alias: 'enqueue.client.default.spool_producer' - public: true - - test_Enqueue\Client\ProducerInterface: - alias: 'Enqueue\Client\ProducerInterface' - public: true - - test_enqueue.client.default.driver: - alias: 'enqueue.client.default.driver' - public: true - - test_enqueue.transport.default.context: - alias: 'enqueue.transport.default.context' - public: true - - test_enqueue.client.consume_command: - alias: 'enqueue.client.consume_command' - public: true - - test.enqueue.client.routes_command: - alias: 'enqueue.client.routes_command' - public: true - - test.enqueue.events.async_processor: - alias: 'enqueue.events.async_processor' - public: true - - test_async_listener: - class: 'Enqueue\Bundle\Tests\Functional\App\TestAsyncListener' - public: true - tags: - - { name: 'kernel.event_listener', async: true, event: 'test_async', method: 'onEvent', dispatcher: 'enqueue.events.event_dispatcher' } - - test_command_subscriber_processor: - class: 'Enqueue\Bundle\Tests\Functional\App\TestCommandSubscriberProcessor' - public: true - tags: - - { name: 'enqueue.command_subscriber', client: 'default' } - - test_topic_subscriber_processor: - class: 'Enqueue\Bundle\Tests\Functional\App\TestTopicSubscriberProcessor' - public: true - tags: - - { name: 'enqueue.topic_subscriber', client: 'default' } - - test_exclusive_command_subscriber_processor: - class: 'Enqueue\Bundle\Tests\Functional\App\TestExclusiveCommandSubscriberProcessor' - public: true - tags: - - { name: 'enqueue.command_subscriber', client: 'default' } - - test_async_subscriber: - class: 'Enqueue\Bundle\Tests\Functional\App\TestAsyncSubscriber' - public: true - tags: - - { name: 'kernel.event_subscriber', async: true, dispatcher: 'enqueue.events.event_dispatcher' } - - test_async_event_transformer: - class: 'Enqueue\Bundle\Tests\Functional\App\TestAsyncEventTransformer' - public: true - arguments: - - '@enqueue.transport.default.context' - tags: - - {name: 'enqueue.event_transformer', eventName: 'test_async', transformerName: 'test_async' } - - {name: 'enqueue.event_transformer', eventName: 'test_async_subscriber', transformerName: 'test_async' } - - # overwrite async listener with one based on client producer. so we can use traceable producer. - enqueue.events.async_listener: - class: 'Enqueue\Bundle\Tests\Functional\App\AsyncListener' - public: true - arguments: ['@enqueue.client.default.producer', '@enqueue.events.registry'] diff --git a/pkg/enqueue-bundle/Tests/Functional/App/config/custom-config-sf5.yml b/pkg/enqueue-bundle/Tests/Functional/App/config/custom-config-sf5.yml deleted file mode 100644 index 35192652e..000000000 --- a/pkg/enqueue-bundle/Tests/Functional/App/config/custom-config-sf5.yml +++ /dev/null @@ -1,85 +0,0 @@ -parameters: - locale: 'en' - secret: 'ThisTokenIsNotSoSecretChangeIt' - -framework: - #esi: ~ - #translator: { fallback: "%locale%" } - test: ~ - assets: false - session: - # the only option incompatible with Symfony 6 - storage_id: session.storage.mock_file - secret: '%secret%' - router: { resource: '%kernel.project_dir%/config/routing.yml' } - default_locale: '%locale%' - -doctrine: - dbal: - connections: - custom: - url: "%env(DOCTRINE_DSN)%" - driver: pdo_mysql - charset: UTF8 - -services: - test_enqueue.client.default.driver: - alias: 'enqueue.client.default.driver' - public: true - - test_enqueue.client.default.producer: - alias: 'enqueue.client.default.producer' - public: true - - test_enqueue.client.default.lazy_producer: - alias: 'enqueue.client.default.lazy_producer' - public: true - - test_enqueue.transport.default.context: - alias: 'enqueue.transport.default.context' - public: true - - test_enqueue.transport.consume_command: - alias: 'enqueue.transport.consume_command' - public: true - - test_enqueue.client.consume_command: - alias: 'enqueue.client.consume_command' - public: true - - test_enqueue.client.produce_command: - alias: 'enqueue.client.produce_command' - public: true - - test_enqueue.client.setup_broker_command: - alias: 'enqueue.client.setup_broker_command' - public: true - - test.message.processor: - class: 'Enqueue\Bundle\Tests\Functional\TestProcessor' - public: true - tags: - - { name: 'enqueue.topic_subscriber', client: 'default' } - - { name: 'enqueue.transport.processor', transport: 'default' } - - test.message.command_processor: - class: 'Enqueue\Bundle\Tests\Functional\TestCommandProcessor' - public: true - tags: - - { name: 'enqueue.command_subscriber', client: 'default' } - - test.sqs_client: - public: true - class: 'Aws\Sqs\SqsClient' - arguments: - - - endpoint: '%env(AWS_SQS_ENDPOINT)%' - region: '%env(AWS_SQS_REGION)%' - version: '%env(AWS_SQS_VERSION)%' - credentials: - key: '%env(AWS_SQS_KEY)%' - secret: '%env(AWS_SQS_SECRET)%' - - test.sqs_custom_connection_factory_factory: - class: 'Enqueue\Bundle\Tests\Functional\App\SqsCustomConnectionFactoryFactory' - arguments: ['@service_container'] diff --git a/pkg/job-queue/Tests/Functional/app/AppKernel.php b/pkg/job-queue/Tests/Functional/app/AppKernel.php index b51969f68..fe31ceb86 100644 --- a/pkg/job-queue/Tests/Functional/app/AppKernel.php +++ b/pkg/job-queue/Tests/Functional/app/AppKernel.php @@ -25,14 +25,8 @@ public function getLogDir(): string return sys_get_temp_dir().'/EnqueueJobQueue/cache/logs'; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { - if (self::VERSION_ID < 60000) { - $loader->load(__DIR__.'/config/config-sf5.yml'); - - return; - } - $loader->load(__DIR__.'/config/config.yml'); } diff --git a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml b/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml deleted file mode 100644 index dd3467e11..000000000 --- a/pkg/job-queue/Tests/Functional/app/config/config-sf5.yml +++ /dev/null @@ -1,33 +0,0 @@ -parameters: - locale: 'en' - secret: 'ThisTokenIsNotSoSecretChangeIt' - -framework: - #esi: ~ - #translator: { fallback: "%locale%" } - test: ~ - assets: false - session: - # the only option incompatible with Symfony 6 - storage_id: session.storage.mock_file - secret: "%secret%" - router: { resource: "%kernel.project_dir%/config/routing.yml" } - default_locale: "%locale%" - -doctrine: - dbal: - url: "%env(DOCTRINE_DSN)%" - driver: pdo_mysql - charset: UTF8 - wrapper_class: "Enqueue\\JobQueue\\Test\\DbalPersistedConnection" - orm: - auto_generate_proxy_classes: true - auto_mapping: true - mappings: - TestEntity: - mapping: true - type: annotation - dir: '%kernel.project_dir%/Tests/Functional/Entity' - alias: 'EnqueueJobQueue' - prefix: 'Enqueue\JobQueue\Tests\Functional\Entity' - is_bundle: false From 8132e718e6ca0018344afc06a61baf31a4556dd9 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Mon, 1 Dec 2025 16:25:36 +0200 Subject: [PATCH 33/57] DBAL 4 compatibility --- docker/bin/refresh-mysql-database.php | 5 +-- docker/bin/refresh-postgres-database.php | 4 ++- pkg/dbal/DbalConnectionFactory.php | 33 ++++++++++++++++--- pkg/dbal/DbalContext.php | 4 +-- .../Spec/Mysql/CreateDbalContextTrait.php | 4 +-- .../Postgresql/CreateDbalContextTrait.php | 4 +-- 6 files changed, 40 insertions(+), 14 deletions(-) diff --git a/docker/bin/refresh-mysql-database.php b/docker/bin/refresh-mysql-database.php index 05e78f43d..72499b52c 100644 --- a/docker/bin/refresh-mysql-database.php +++ b/docker/bin/refresh-mysql-database.php @@ -9,8 +9,9 @@ $dbalContext = (new DbalConnectionFactory($dsn))->createContext(); -$dbalContext->getDbalConnection()->getSchemaManager()->dropAndCreateDatabase($database); -$dbalContext->getDbalConnection()->exec('USE '.$database); +$dbalContext->getDbalConnection()->createSchemaManager()->dropDatabase($database); +$dbalContext->getDbalConnection()->createSchemaManager()->createDatabase($database); +$dbalContext->getDbalConnection()->executeQuery('USE '.$database); $dbalContext->createDataBaseTable(); echo 'MySQL Database is updated'.\PHP_EOL; diff --git a/docker/bin/refresh-postgres-database.php b/docker/bin/refresh-postgres-database.php index 1d96c3c07..a2574614a 100644 --- a/docker/bin/refresh-postgres-database.php +++ b/docker/bin/refresh-postgres-database.php @@ -8,7 +8,9 @@ $dbalContext = (new DbalConnectionFactory($dsn))->createContext(); -$dbalContext->getDbalConnection()->getSchemaManager()->dropAndCreateDatabase('postgres'); +$database = 'postgres'; +$dbalContext->getDbalConnection()->createSchemaManager()->dropDatabase($database); +$dbalContext->getDbalConnection()->createSchemaManager()->createDatabase($database); $dbalContext->createDataBaseTable(); echo 'Postgresql Database is updated'.\PHP_EOL; diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index aa0fe135e..b85ac24e6 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; +use Doctrine\DBAL\Tools\DsnParser; use Enqueue\Dsn\Dsn; use Interop\Queue\ConnectionFactory; use Interop\Queue\Context; @@ -142,13 +143,35 @@ private function parseDsn(string $dsn, ?array $config = null): array ]; } + if (class_exists(DsnParser::class)) { // DBAL >= 4 + if ($dsnHasProtocolOnly) { + $dsn = $parsedDsn->getScheme().'://root@localhost'; + } + + $doctrineSupported = []; + foreach ($supported as $k => $v) { + $doctrineSupported[$this->prepareDsnForDoctrine($k)] = $this->prepareDsnForDoctrine($v); + } + $dsnParser = new DsnParser($doctrineSupported); + + return [ + 'lazy' => true, + 'connection' => $dsnParser->parse($this->prepareDsnForDoctrine($dsn)), + ]; + } + + $dsn = $dsnHasProtocolOnly ? + $doctrineScheme.'://root@localhost' : + str_replace($parsedDsn->getScheme(), $doctrineScheme, $dsn); + return [ 'lazy' => true, - 'connection' => [ - 'url' => $dsnHasProtocolOnly ? - $doctrineScheme.'://root@localhost' : - str_replace($parsedDsn->getScheme(), $doctrineScheme, $dsn), - ], + 'connection' => ['url' => $dsn], ]; } + + private function prepareDsnForDoctrine(string $dsn): string + { + return preg_replace('/^([a-z0-9]+)\+pdo/i', 'pdo-$1', $dsn); + } } diff --git a/pkg/dbal/DbalContext.php b/pkg/dbal/DbalContext.php index 869dd67b8..856406a8b 100644 --- a/pkg/dbal/DbalContext.php +++ b/pkg/dbal/DbalContext.php @@ -209,7 +209,7 @@ public function getDbalConnection(): Connection public function createDataBaseTable(): void { - $sm = $this->getDbalConnection()->getSchemaManager(); + $sm = $this->getDbalConnection()->createSchemaManager(); if ($sm->tablesExist([$this->getTableName()])) { return; @@ -223,7 +223,7 @@ public function createDataBaseTable(): void $table->addColumn('headers', DbalType::TEXT, ['notnull' => false]); $table->addColumn('properties', DbalType::TEXT, ['notnull' => false]); $table->addColumn('redelivered', DbalType::BOOLEAN, ['notnull' => false]); - $table->addColumn('queue', DbalType::STRING); + $table->addColumn('queue', DbalType::STRING, ['length' => 255]); $table->addColumn('priority', DbalType::SMALLINT, ['notnull' => false]); $table->addColumn('delayed_until', DbalType::BIGINT, ['notnull' => false]); $table->addColumn('time_to_live', DbalType::BIGINT, ['notnull' => false]); diff --git a/pkg/dbal/Tests/Spec/Mysql/CreateDbalContextTrait.php b/pkg/dbal/Tests/Spec/Mysql/CreateDbalContextTrait.php index 8f76cb2ff..8265bc18f 100644 --- a/pkg/dbal/Tests/Spec/Mysql/CreateDbalContextTrait.php +++ b/pkg/dbal/Tests/Spec/Mysql/CreateDbalContextTrait.php @@ -16,8 +16,8 @@ protected function createDbalContext() $context = $factory->createContext(); - if ($context->getDbalConnection()->getSchemaManager()->tablesExist([$context->getTableName()])) { - $context->getDbalConnection()->getSchemaManager()->dropTable($context->getTableName()); + if ($context->getDbalConnection()->createSchemaManager()->tablesExist([$context->getTableName()])) { + $context->getDbalConnection()->createSchemaManager()->dropTable($context->getTableName()); } $context->createDataBaseTable(); diff --git a/pkg/dbal/Tests/Spec/Postgresql/CreateDbalContextTrait.php b/pkg/dbal/Tests/Spec/Postgresql/CreateDbalContextTrait.php index fe5a19a0c..709980e87 100644 --- a/pkg/dbal/Tests/Spec/Postgresql/CreateDbalContextTrait.php +++ b/pkg/dbal/Tests/Spec/Postgresql/CreateDbalContextTrait.php @@ -16,8 +16,8 @@ protected function createDbalContext() $context = $factory->createContext(); - if ($context->getDbalConnection()->getSchemaManager()->tablesExist([$context->getTableName()])) { - $context->getDbalConnection()->getSchemaManager()->dropTable($context->getTableName()); + if ($context->getDbalConnection()->createSchemaManager()->tablesExist([$context->getTableName()])) { + $context->getDbalConnection()->createSchemaManager()->dropTable($context->getTableName()); } $context->createDataBaseTable(); From fff2dc94c487c9cfe7d5886fa2446ca0d7067367 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Mon, 1 Dec 2025 16:25:49 +0200 Subject: [PATCH 34/57] ORM 3 compat --- pkg/job-queue/Tests/Functional/app/config/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/job-queue/Tests/Functional/app/config/config.yml b/pkg/job-queue/Tests/Functional/app/config/config.yml index 0121acdbf..578a21df9 100644 --- a/pkg/job-queue/Tests/Functional/app/config/config.yml +++ b/pkg/job-queue/Tests/Functional/app/config/config.yml @@ -20,7 +20,6 @@ doctrine: charset: UTF8 wrapper_class: "Enqueue\\JobQueue\\Test\\DbalPersistedConnection" orm: - auto_generate_proxy_classes: true auto_mapping: true mappings: TestEntity: From 1bdad59f46d4cef9893dfdeb867ef766c71933a4 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Tue, 2 Dec 2025 10:35:24 +0200 Subject: [PATCH 35/57] Simplify DSN stuff again --- docker-compose.yml | 2 +- pkg/dbal/DbalConnectionFactory.php | 30 ++++++++++++------------------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c551f8e71..b724d7881 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: - STOMP_DSN=stomp://guest:guest@rabbitmq:61613/mqdev - RABITMQ_STOMP_DSN=stomp+rabbitmq://guest:guest@rabbitmq:61613/mqdev - RABBITMQ_MANAGMENT_DSN=http://guest:guest@rabbitmq:15672/mqdev - - DOCTRINE_DSN=mysql+pdo://root:rootpass@mysql/mqdev + - DOCTRINE_DSN=mysql://root:rootpass@mysql/mqdev - DOCTRINE_POSTGRES_DSN=postgres://postgres:pass@postgres/template1 - MYSQL_DSN=mysql://root:rootpass@mysql/mqdev - POSTGRES_DSN=postgres://postgres:pass@postgres/postgres diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index b85ac24e6..c2c8bab3b 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -106,18 +106,21 @@ private function parseDsn(string $dsn, ?array $config = null): array { $parsedDsn = Dsn::parseFirst($dsn); + // enqueue scheme => dbal scheme + // out of the box dbal 4 schemes: pdo_mysql, pdo_sqlite, pdo_pgsql, pdo_oci, oci8, ibm_db2, pdo_sqlsrv, mysqli, pgsql, sqlsrv, sqlite3 + // in case of multiple drivers like mysqli vs pdo_mysql the pdo variant is preferred $supported = [ - 'db2' => 'db2', - 'ibm-db2' => 'ibm-db2', - 'mssql' => 'mssql', + 'db2' => 'ibm_db2', + 'ibm-db2' => 'ibm_db2', + 'mssql' => 'pdo_sqlsrv', 'sqlsrv+pdo' => 'pdo_sqlsrv', - 'mysql' => 'mysql', - 'mysql2' => 'mysql2', + 'mysql' => 'pdo_mysql', + 'mysql2' => 'mysqli', 'mysql+pdo' => 'pdo_mysql', 'pgsql' => 'pgsql', - 'postgres' => 'postgres', + 'postgres' => 'pdo_pgsql', 'pgsql+pdo' => 'pdo_pgsql', - 'sqlite' => 'sqlite', + 'sqlite' => 'sqlite3', 'sqlite3' => 'sqlite3', 'sqlite+pdo' => 'pdo_sqlite', ]; @@ -148,15 +151,11 @@ private function parseDsn(string $dsn, ?array $config = null): array $dsn = $parsedDsn->getScheme().'://root@localhost'; } - $doctrineSupported = []; - foreach ($supported as $k => $v) { - $doctrineSupported[$this->prepareDsnForDoctrine($k)] = $this->prepareDsnForDoctrine($v); - } - $dsnParser = new DsnParser($doctrineSupported); + $dsnParser = new DsnParser($supported); return [ 'lazy' => true, - 'connection' => $dsnParser->parse($this->prepareDsnForDoctrine($dsn)), + 'connection' => $dsnParser->parse($dsn), ]; } @@ -169,9 +168,4 @@ private function parseDsn(string $dsn, ?array $config = null): array 'connection' => ['url' => $dsn], ]; } - - private function prepareDsnForDoctrine(string $dsn): string - { - return preg_replace('/^([a-z0-9]+)\+pdo/i', 'pdo-$1', $dsn); - } } From 440c84012b0ec668de4144a85ff1fd3012804d7d Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 14:03:32 +0200 Subject: [PATCH 36/57] Fix DSN tests --- .../Tests/DbalConnectionFactoryConfigTest.php | 47 +++++++++++++++---- pkg/dbal/Tests/DbalConnectionFactoryTest.php | 6 +-- 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php index 5929e1479..dffb88205 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php @@ -56,7 +56,9 @@ public static function provideConfigs() null, [ 'connection' => [ - 'url' => 'mysql://root@localhost', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -68,7 +70,9 @@ public static function provideConfigs() 'mysql:', [ 'connection' => [ - 'url' => 'mysql://root@localhost', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -80,7 +84,9 @@ public static function provideConfigs() 'mysql+pdo:', [ 'connection' => [ - 'url' => 'pdo_mysql://root@localhost', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -92,7 +98,9 @@ public static function provideConfigs() 'pgsql:', [ 'connection' => [ - 'url' => 'pgsql://root@localhost', + 'driver' => 'pgsql', + 'host' => 'localhost', + 'user' => 'root', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -158,7 +166,12 @@ public static function provideConfigs() [ 'connection' => [ 'foo' => 'fooValue', - 'url' => 'pdo_mysql://user:pass@host:10000/db', + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10000, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -171,6 +184,12 @@ public static function provideConfigs() [ 'connection' => [ 'url' => 'mysql://user:pass@host:10000/db', + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10000, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -182,7 +201,12 @@ public static function provideConfigs() 'mysql+pdo://user:pass@host:10001/db', [ 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10001/db', + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10001, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -194,7 +218,9 @@ public static function provideConfigs() [], [ 'connection' => [ - 'url' => 'mysql://root@localhost', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -219,7 +245,12 @@ public static function provideConfigs() ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], [ 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10001/db', + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10001, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, diff --git a/pkg/dbal/Tests/DbalConnectionFactoryTest.php b/pkg/dbal/Tests/DbalConnectionFactoryTest.php index 105466c26..302a7dd65 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryTest.php @@ -41,8 +41,8 @@ public function testShouldParseGenericDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - $this->assertArrayHasKey('url', $config['connection']); - $this->assertEquals('pdo_pgsql://foo@bar', $config['connection']['url']); + $this->assertArrayHasKey('driver', $config['connection']); + $this->assertEquals('pdo_pgsql', $config['connection']['driver']); } public function testShouldParseSqliteAbsolutePathDSN() @@ -55,7 +55,7 @@ public function testShouldParseSqliteAbsolutePathDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - $this->assertArrayHasKey('url', $config['connection']); + $this->assertArrayHasKey('driver', $config['connection']); $this->assertEquals('pdo_sqlite:////tmp/some.sq3', $config['connection']['url']); } } From 12bd6c65c10fc55b0a4dcfc0d6d498b526aa435c Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 14:06:05 +0200 Subject: [PATCH 37/57] Remove PHP 8.1 from CI, it's EOL on 2025.12.31. Also clean up 8.5 for now --- .github/workflows/ci.yml | 16 ++-------------- pkg/amqp-bunny/.github/workflows/ci.yml | 2 +- pkg/amqp-ext/.github/workflows/ci.yml | 2 +- pkg/amqp-lib/.github/workflows/ci.yml | 2 +- pkg/amqp-tools/.github/workflows/ci.yml | 2 +- pkg/async-command/.github/workflows/ci.yml | 2 +- .../.github/workflows/ci.yml | 2 +- pkg/dbal/.github/workflows/ci.yml | 2 +- pkg/dsn/.github/workflows/ci.yml | 2 +- pkg/enqueue-bundle/.github/workflows/ci.yml | 2 +- pkg/enqueue/.github/workflows/ci.yml | 2 +- pkg/fs/.github/workflows/ci.yml | 2 +- pkg/gearman/.github/workflows/ci.yml | 2 +- pkg/gps/.github/workflows/ci.yml | 2 +- pkg/job-queue/.github/workflows/ci.yml | 2 +- pkg/mongodb/.github/workflows/ci.yml | 2 +- pkg/monitoring/.github/workflows/ci.yml | 2 +- pkg/null/.github/workflows/ci.yml | 2 +- pkg/pheanstalk/.github/workflows/ci.yml | 2 +- pkg/rdkafka/.github/workflows/ci.yml | 2 +- pkg/redis/.github/workflows/ci.yml | 2 +- pkg/simple-client/.github/workflows/ci.yml | 2 +- pkg/sns/.github/workflows/ci.yml | 2 +- pkg/snsqs/.github/workflows/ci.yml | 2 +- pkg/sqs/.github/workflows/ci.yml | 2 +- pkg/stomp/.github/workflows/ci.yml | 2 +- pkg/wamp/.github/workflows/ci.yml | 2 +- 27 files changed, 28 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6f668b96..a4467318c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,16 +77,10 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - - php: '8.1' - symfony_version: '7.3.*' - - php: '8.1' - symfony_version: '7.4.*' - - php: '8.1' - symfony_version: '8.0.*' - php: '8.2' symfony_version: '8.0.*' - php: '8.3' @@ -129,16 +123,10 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2', '8.3', '8.4'] + php: ['8.2', '8.3', '8.4'] symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - - php: '8.1' - symfony_version: '7.3.*' - - php: '8.1' - symfony_version: '7.4.*' - - php: '8.1' - symfony_version: '8.0.*' - php: '8.2' symfony_version: '8.0.*' - php: '8.3' diff --git a/pkg/amqp-bunny/.github/workflows/ci.yml b/pkg/amqp-bunny/.github/workflows/ci.yml index cb2496813..e2e4f9400 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-ext/.github/workflows/ci.yml b/pkg/amqp-ext/.github/workflows/ci.yml index 16bb84a87..530b82994 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-lib/.github/workflows/ci.yml b/pkg/amqp-lib/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/amqp-tools/.github/workflows/ci.yml b/pkg/amqp-tools/.github/workflows/ci.yml index cb2496813..e2e4f9400 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/async-command/.github/workflows/ci.yml b/pkg/async-command/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/async-event-dispatcher/.github/workflows/ci.yml b/pkg/async-event-dispatcher/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/dbal/.github/workflows/ci.yml b/pkg/dbal/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/dsn/.github/workflows/ci.yml b/pkg/dsn/.github/workflows/ci.yml index 11567d7a6..4bbfaeb39 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/enqueue-bundle/.github/workflows/ci.yml b/pkg/enqueue-bundle/.github/workflows/ci.yml index 0dc4592d9..029f841a1 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/enqueue/.github/workflows/ci.yml b/pkg/enqueue/.github/workflows/ci.yml index d533732a6..6e34448f2 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/fs/.github/workflows/ci.yml b/pkg/fs/.github/workflows/ci.yml index 1ebc0553d..5c20f9451 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/gearman/.github/workflows/ci.yml b/pkg/gearman/.github/workflows/ci.yml index c92f597a3..2d3ee49f1 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/gps/.github/workflows/ci.yml b/pkg/gps/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/job-queue/.github/workflows/ci.yml b/pkg/job-queue/.github/workflows/ci.yml index 736390c3a..3e9ffb514 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/mongodb/.github/workflows/ci.yml b/pkg/mongodb/.github/workflows/ci.yml index 26f0ab81a..a0decabb6 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/monitoring/.github/workflows/ci.yml b/pkg/monitoring/.github/workflows/ci.yml index cb2496813..e2e4f9400 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/null/.github/workflows/ci.yml b/pkg/null/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/pheanstalk/.github/workflows/ci.yml b/pkg/pheanstalk/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/rdkafka/.github/workflows/ci.yml b/pkg/rdkafka/.github/workflows/ci.yml index b36a960aa..d589081e5 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/redis/.github/workflows/ci.yml b/pkg/redis/.github/workflows/ci.yml index eccb7baed..9b88b361f 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/simple-client/.github/workflows/ci.yml b/pkg/simple-client/.github/workflows/ci.yml index da80afd96..6bf7ab71b 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: ['8.1', '8.2', '8.3', '8.4'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/sns/.github/workflows/ci.yml b/pkg/sns/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/snsqs/.github/workflows/ci.yml b/pkg/snsqs/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/sqs/.github/workflows/ci.yml b/pkg/sqs/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/stomp/.github/workflows/ci.yml b/pkg/stomp/.github/workflows/ci.yml index ee354264b..887ff0eba 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests diff --git a/pkg/wamp/.github/workflows/ci.yml b/pkg/wamp/.github/workflows/ci.yml index cb2496813..e2e4f9400 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: ['8.1', '8.2', '8.3', '8.4', '8.5'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests From 9c8669b81b040418a4c5fff7e313b3c0d9d0f18d Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 14:09:23 +0200 Subject: [PATCH 38/57] aws-sdk dropped old guzzle/psr7 and older aws versions no longer install, huh --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d5f2c0e44..b0ddd6c9e 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "influxdb/influxdb-php": "^1.14", "datadog/php-datadogstatsd": "^1.3", "guzzlehttp/guzzle": "^7.0.1", - "guzzlehttp/psr7": "^1.9.1", + "guzzlehttp/psr7": "^2.4.5", "php-http/discovery": "^1.13", "voryx/thruway-common": "^1.0.1", "react/dns": "^1.4", From d811f9902cbdb15cfdd177f6898722904a67f4a0 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 14:46:11 +0200 Subject: [PATCH 39/57] Fix CS job --- .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 a4467318c..715c94cf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: extensions: mongodb, redis, :xdebug ini-values: memory_limit=2048M - - run: php ./bin/fix-symfony-version.php "5.4.*" + - run: php ./bin/fix-symfony-version.php "7.4.*" - run: composer update --no-progress From d804a1d02487f96ae68fade833ef73165f272c5e Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 14:47:15 +0200 Subject: [PATCH 40/57] derp --- pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php index dffb88205..9c5189474 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php @@ -183,7 +183,6 @@ public static function provideConfigs() 'mysql://user:pass@host:10000/db', [ 'connection' => [ - 'url' => 'mysql://user:pass@host:10000/db', 'driver' => 'pdo_mysql', 'host' => 'host', 'port' => 10000, From e2ff7e1c4e08db9452e1eb29af52e2b7c67cd6c5 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 15:43:58 +0200 Subject: [PATCH 41/57] Fix deprecation --- pkg/test/ReadAttributeTrait.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/test/ReadAttributeTrait.php b/pkg/test/ReadAttributeTrait.php index 5b9758a64..2b0208764 100644 --- a/pkg/test/ReadAttributeTrait.php +++ b/pkg/test/ReadAttributeTrait.php @@ -6,12 +6,7 @@ trait ReadAttributeTrait { public function readAttribute(object $object, string $attribute) { - $refProperty = $this->getClassAttribute($object, $attribute); - $refProperty->setAccessible(true); - $value = $refProperty->getValue($object); - $refProperty->setAccessible(false); - - return $value; + return $this->getClassAttribute($object, $attribute)->getValue($object); } private function getClassAttribute( From ee38f857bcca757a86219bff2d91745d49d13c14 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 15:54:35 +0200 Subject: [PATCH 42/57] Fix DSN parsing --- pkg/dbal/DbalConnectionFactory.php | 7 +++++++ pkg/dbal/Tests/DbalConnectionFactoryTest.php | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index c2c8bab3b..0e15107ad 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -153,6 +153,13 @@ private function parseDsn(string $dsn, ?array $config = null): array $dsnParser = new DsnParser($supported); + // replace scheme with the matching one from the supported list, but the prefixes there are "pdo-" not "pdo_" + $dsn = preg_replace( + '/^' . preg_quote($parsedDsn->getScheme(), '/') . '(:|:\/\/)/', + str_replace('_','-', $supported[$parsedDsn->getScheme()]) . '$1', + $dsn, + ); + return [ 'lazy' => true, 'connection' => $dsnParser->parse($dsn), diff --git a/pkg/dbal/Tests/DbalConnectionFactoryTest.php b/pkg/dbal/Tests/DbalConnectionFactoryTest.php index 302a7dd65..0bec4a51a 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryTest.php @@ -55,7 +55,7 @@ public function testShouldParseSqliteAbsolutePathDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - $this->assertArrayHasKey('driver', $config['connection']); - $this->assertEquals('pdo_sqlite:////tmp/some.sq3', $config['connection']['url']); + $this->assertArrayHasKey('path', $config['connection']); + $this->assertEquals('/tmp/some.sq3', $config['connection']['path']); } } From 667fe8417b5d55cdf85856281748124052bc5401 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 15:56:41 +0200 Subject: [PATCH 43/57] Fix CS --- pkg/dbal/DbalConnectionFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index 0e15107ad..96f04e3db 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -155,8 +155,8 @@ private function parseDsn(string $dsn, ?array $config = null): array // replace scheme with the matching one from the supported list, but the prefixes there are "pdo-" not "pdo_" $dsn = preg_replace( - '/^' . preg_quote($parsedDsn->getScheme(), '/') . '(:|:\/\/)/', - str_replace('_','-', $supported[$parsedDsn->getScheme()]) . '$1', + '/^'.preg_quote($parsedDsn->getScheme(), '/').'(:|:\/\/)/', + str_replace('_','-', $supported[$parsedDsn->getScheme()]).'$1', $dsn, ); From 217544d48d7d629bee8ca3ac21296034c9feb116 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 21:01:51 +0200 Subject: [PATCH 44/57] Fix compat --- .../DependencyInjection/AsyncTransformersPass.php | 2 +- pkg/dbal/DbalConsumerHelperTrait.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/async-event-dispatcher/DependencyInjection/AsyncTransformersPass.php b/pkg/async-event-dispatcher/DependencyInjection/AsyncTransformersPass.php index 89046dd58..4ee286b25 100644 --- a/pkg/async-event-dispatcher/DependencyInjection/AsyncTransformersPass.php +++ b/pkg/async-event-dispatcher/DependencyInjection/AsyncTransformersPass.php @@ -7,7 +7,7 @@ class AsyncTransformersPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (false == $container->hasDefinition('enqueue.events.registry')) { return; diff --git a/pkg/dbal/DbalConsumerHelperTrait.php b/pkg/dbal/DbalConsumerHelperTrait.php index 617f37ba0..821eeac7c 100644 --- a/pkg/dbal/DbalConsumerHelperTrait.php +++ b/pkg/dbal/DbalConsumerHelperTrait.php @@ -53,7 +53,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa while (microtime(true) < $endAt) { try { - $result = $select->execute()->fetchAssociative(); + $result = $select->executeQuery()->fetchAssociative(); if (empty($result)) { return null; } @@ -61,14 +61,14 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa $update ->setParameter('messageId', $result['id'], DbalType::GUID); - if ($update->execute()) { + if ($update->executeQuery()) { $deliveredMessage = $this->getConnection()->createQueryBuilder() ->select('*') ->from($this->getContext()->getTableName()) ->andWhere('delivery_id = :deliveryId') ->setParameter('deliveryId', $deliveryId, DbalType::GUID) ->setMaxResults(1) - ->execute() + ->executeQuery() ->fetchAssociative(); // the message has been removed by a 3rd party, such as truncate operation. @@ -108,7 +108,7 @@ protected function redeliverMessages(): void ; try { - $update->execute(); + $update->executeQuery(); $this->redeliverMessagesLastExecutedAt = microtime(true); } catch (RetryableException $e) { @@ -135,7 +135,7 @@ protected function removeExpiredMessages(): void ; try { - $delete->execute(); + $delete->executeQuery(); } catch (RetryableException $e) { // maybe next time we'll get more luck } From b8e283ff42b2acd3038a9f550f463813f7c8188d Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Fri, 19 Dec 2025 21:07:16 +0200 Subject: [PATCH 45/57] CS derp --- pkg/dbal/DbalConnectionFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index 96f04e3db..d8daa1333 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -156,7 +156,7 @@ private function parseDsn(string $dsn, ?array $config = null): array // replace scheme with the matching one from the supported list, but the prefixes there are "pdo-" not "pdo_" $dsn = preg_replace( '/^'.preg_quote($parsedDsn->getScheme(), '/').'(:|:\/\/)/', - str_replace('_','-', $supported[$parsedDsn->getScheme()]).'$1', + str_replace('_', '-', $supported[$parsedDsn->getScheme()]).'$1', $dsn, ); From e017c624f8cd5cdab03fb6e7fdca8cf75b719904 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 10:42:02 +0200 Subject: [PATCH 46/57] Restore doctrine/orm requirement, add 3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b0ddd6c9e..ae178097d 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "psr/container": "^1.1 || ^2.0", "makasim/temp-file": "^0.2", "google/cloud-pubsub": "^1.46", - "doctrine/orm": "3.6.x-dev", + "doctrine/orm": "^2.12|^3.5", "doctrine/persistence": "^2.0|^3.0|^4.0", "mongodb/mongodb": "^1.17", "pda/pheanstalk": "^3.1", From 61ca9286983f60e82e74c025e42835665eabb2f3 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 10:58:05 +0200 Subject: [PATCH 47/57] Bump doctrine orm and persistence lowest --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ae178097d..377b16215 100644 --- a/composer.json +++ b/composer.json @@ -26,8 +26,8 @@ "psr/container": "^1.1 || ^2.0", "makasim/temp-file": "^0.2", "google/cloud-pubsub": "^1.46", - "doctrine/orm": "^2.12|^3.5", - "doctrine/persistence": "^2.0|^3.0|^4.0", + "doctrine/orm": "^2.20|^3.5", + "doctrine/persistence": "^3.4|^4.1", "mongodb/mongodb": "^1.17", "pda/pheanstalk": "^3.1", "aws/aws-sdk-php": "^3.290", From 36ffefc85d372ec36ec26fee948668422ba3999c Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 11:28:32 +0200 Subject: [PATCH 48/57] Fix DBAL 3 compat --- pkg/dbal/DbalConnectionFactory.php | 1 + .../Tests/DbalConnectionFactoryConfigTest.php | 597 ++++++++++++------ pkg/dbal/Tests/DbalConnectionFactoryTest.php | 33 +- 3 files changed, 422 insertions(+), 209 deletions(-) diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index d8daa1333..735818a46 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -91,6 +91,7 @@ private function establishConnection(): Connection method_exists($this->connection, 'connect') && (new \ReflectionMethod($this->connection, 'connect'))->isPublic() ) { + // TODO: remove check when dropping support for DBAL < 4 // DBAL < 4 $this->connection->connect(); } else { diff --git a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php index 9c5189474..65816cc38 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php @@ -2,6 +2,7 @@ namespace Enqueue\Dbal\Tests; +use Doctrine\DBAL\Connection; use Enqueue\Dbal\DbalConnectionFactory; use Enqueue\Test\ClassExtensionTrait; use Enqueue\Test\ReadAttributeTrait; @@ -52,210 +53,396 @@ public function testShouldParseConfigurationAsExpected($config, $expectedConfig) public static function provideConfigs() { - yield [ - null, - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql:', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql+pdo:', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'pgsql:', - [ - 'connection' => [ - 'driver' => 'pgsql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo:', - 'connection' => [ - 'dbname' => 'customDbName', - ], - ], - [ - 'connection' => [ - 'dbname' => 'customDbName', - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'port' => '3306', - 'user' => 'root', - 'password' => '', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo:', - 'connection' => [ - 'dbname' => 'customDbName', - 'host' => 'host', - 'port' => '10000', - 'user' => 'user', - 'password' => 'pass', - ], - ], - [ - 'connection' => [ - 'dbname' => 'customDbName', - 'host' => 'host', - 'port' => '10000', - 'user' => 'user', - 'password' => 'pass', - 'driver' => 'pdo_mysql', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo://user:pass@host:10000/db', - 'connection' => [ - 'foo' => 'fooValue', - ], - ], - [ - 'connection' => [ - 'foo' => 'fooValue', - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10000, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql://user:pass@host:10000/db', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10000, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql+pdo://user:pass@host:10001/db', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10001, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [], - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], - 'table_name' => 'a_queue_table', - ], - [ - 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], - 'table_name' => 'a_queue_table', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10001, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - 'foo' => 'fooVal', - ], - ]; + // TODO: remove check when dropping support for DBAL < 4 + if ( + method_exists(Connection::class, 'connect') + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { + // DBAL < 4 + + yield [ + null, + [ + 'connection' => [ + 'url' => 'pdo_mysql://root@localhost' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql:', + [ + 'connection' => [ + 'url' => 'pdo_mysql://root@localhost' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql+pdo:', + [ + 'connection' => [ + 'url' => 'pdo_mysql://root@localhost' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'pgsql:', + [ + 'connection' => [ + 'url' => 'pgsql://root@localhost' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo:', + 'connection' => [ + 'dbname' => 'customDbName', + ], + ], + [ + 'connection' => [ + 'dbname' => 'customDbName', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'port' => '3306', + 'user' => 'root', + 'password' => '', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo:', + 'connection' => [ + 'dbname' => 'customDbName', + 'host' => 'host', + 'port' => '10000', + 'user' => 'user', + 'password' => 'pass', + ], + ], + [ + 'connection' => [ + 'dbname' => 'customDbName', + 'host' => 'host', + 'port' => '10000', + 'user' => 'user', + 'password' => 'pass', + 'driver' => 'pdo_mysql', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo://user:pass@host:10000/db', + 'connection' => [ + 'foo' => 'fooValue', + ], + ], + [ + 'connection' => [ + 'foo' => 'fooValue', + 'url' => 'pdo_mysql://user:pass@host:10000/db' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql://user:pass@host:10000/db', + [ + 'connection' => [ + 'url' => 'pdo_mysql://user:pass@host:10000/db' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql+pdo://user:pass@host:10001/db', + [ + 'connection' => [ + 'url' => 'pdo_mysql://user:pass@host:10001/db' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [], + [ + 'connection' => [ + 'url' => 'pdo_mysql://root@localhost', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], + 'table_name' => 'a_queue_table', + ], + [ + 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], + 'table_name' => 'a_queue_table', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], + [ + 'connection' => [ + 'url' => 'pdo_mysql://user:pass@host:10001/db' + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + 'foo' => 'fooVal', + ], + ]; + } else { + // DBAL >= 4 + + yield [ + null, + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql:', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql+pdo:', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'pgsql:', + [ + 'connection' => [ + 'driver' => 'pgsql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo:', + 'connection' => [ + 'dbname' => 'customDbName', + ], + ], + [ + 'connection' => [ + 'dbname' => 'customDbName', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'port' => '3306', + 'user' => 'root', + 'password' => '', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo:', + 'connection' => [ + 'dbname' => 'customDbName', + 'host' => 'host', + 'port' => '10000', + 'user' => 'user', + 'password' => 'pass', + ], + ], + [ + 'connection' => [ + 'dbname' => 'customDbName', + 'host' => 'host', + 'port' => '10000', + 'user' => 'user', + 'password' => 'pass', + 'driver' => 'pdo_mysql', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo://user:pass@host:10000/db', + 'connection' => [ + 'foo' => 'fooValue', + ], + ], + [ + 'connection' => [ + 'foo' => 'fooValue', + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10000, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql://user:pass@host:10000/db', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10000, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql+pdo://user:pass@host:10001/db', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10001, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [], + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], + 'table_name' => 'a_queue_table', + ], + [ + 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], + 'table_name' => 'a_queue_table', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10001, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + 'foo' => 'fooVal', + ], + ]; + } } } diff --git a/pkg/dbal/Tests/DbalConnectionFactoryTest.php b/pkg/dbal/Tests/DbalConnectionFactoryTest.php index 0bec4a51a..ddf7838a2 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryTest.php @@ -2,6 +2,7 @@ namespace Enqueue\Dbal\Tests; +use Doctrine\DBAL\Connection; use Enqueue\Dbal\DbalConnectionFactory; use Enqueue\Dbal\DbalContext; use Enqueue\Test\ClassExtensionTrait; @@ -41,8 +42,20 @@ public function testShouldParseGenericDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - $this->assertArrayHasKey('driver', $config['connection']); - $this->assertEquals('pdo_pgsql', $config['connection']['driver']); + + // TODO: remove check when dropping support for DBAL < 4 + if ( + method_exists(Connection::class, 'connect') + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { + // DBAL < 4 + $this->assertArrayHasKey('url', $config['connection']); + $this->assertEquals('pdo-pgsql://foo@bar', $config['connection']['url']); + } else { + // DBAL >= 4 + $this->assertArrayHasKey('driver', $config['connection']); + $this->assertEquals('pdo_pgsql', $config['connection']['driver']); + } } public function testShouldParseSqliteAbsolutePathDSN() @@ -55,7 +68,19 @@ public function testShouldParseSqliteAbsolutePathDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - $this->assertArrayHasKey('path', $config['connection']); - $this->assertEquals('/tmp/some.sq3', $config['connection']['path']); + + // TODO: remove check when dropping support for DBAL < 4 + if ( + method_exists(Connection::class, 'connect') + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { + // DBAL < 4 + $this->assertArrayHasKey('url', $config['connection']); + $this->assertEquals('pdo-sqlite:////tmp/some.sq3', $config['connection']['url']); + } else { + // DBAL >= 4 + $this->assertArrayHasKey('path', $config['connection']); + $this->assertEquals('/tmp/some.sq3', $config['connection']['path']); + } } } From 1055259fce013186839b7a007c8e8728d3172656 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 11:31:31 +0200 Subject: [PATCH 49/57] derpito --- .../Tests/DbalConnectionFactoryConfigTest.php | 16 ++++++++-------- pkg/dbal/Tests/DbalConnectionFactoryTest.php | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php index 65816cc38..14f67cf8c 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php @@ -64,7 +64,7 @@ public static function provideConfigs() null, [ 'connection' => [ - 'url' => 'pdo_mysql://root@localhost' + 'url' => 'pdo_mysql://root@localhost', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -76,7 +76,7 @@ public static function provideConfigs() 'mysql:', [ 'connection' => [ - 'url' => 'pdo_mysql://root@localhost' + 'url' => 'pdo_mysql://root@localhost', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -88,7 +88,7 @@ public static function provideConfigs() 'mysql+pdo:', [ 'connection' => [ - 'url' => 'pdo_mysql://root@localhost' + 'url' => 'pdo_mysql://root@localhost', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -100,7 +100,7 @@ public static function provideConfigs() 'pgsql:', [ 'connection' => [ - 'url' => 'pgsql://root@localhost' + 'url' => 'pgsql://root@localhost', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -166,7 +166,7 @@ public static function provideConfigs() [ 'connection' => [ 'foo' => 'fooValue', - 'url' => 'pdo_mysql://user:pass@host:10000/db' + 'url' => 'pdo_mysql://user:pass@host:10000/db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -178,7 +178,7 @@ public static function provideConfigs() 'mysql://user:pass@host:10000/db', [ 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10000/db' + 'url' => 'pdo_mysql://user:pass@host:10000/db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -190,7 +190,7 @@ public static function provideConfigs() 'mysql+pdo://user:pass@host:10001/db', [ 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10001/db' + 'url' => 'pdo_mysql://user:pass@host:10001/db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -227,7 +227,7 @@ public static function provideConfigs() ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], [ 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10001/db' + 'url' => 'pdo_mysql://user:pass@host:10001/db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, diff --git a/pkg/dbal/Tests/DbalConnectionFactoryTest.php b/pkg/dbal/Tests/DbalConnectionFactoryTest.php index ddf7838a2..76b34c834 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryTest.php @@ -50,7 +50,7 @@ public function testShouldParseGenericDSN() ) { // DBAL < 4 $this->assertArrayHasKey('url', $config['connection']); - $this->assertEquals('pdo-pgsql://foo@bar', $config['connection']['url']); + $this->assertEquals('pdo_pgsql://foo@bar', $config['connection']['url']); } else { // DBAL >= 4 $this->assertArrayHasKey('driver', $config['connection']); @@ -76,7 +76,7 @@ public function testShouldParseSqliteAbsolutePathDSN() ) { // DBAL < 4 $this->assertArrayHasKey('url', $config['connection']); - $this->assertEquals('pdo-sqlite:////tmp/some.sq3', $config['connection']['url']); + $this->assertEquals('pdo_sqlite:////tmp/some.sq3', $config['connection']['url']); } else { // DBAL >= 4 $this->assertArrayHasKey('path', $config['connection']); From 5c3d743b5f897f6239fd0ae35ed30f0e791b208e Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 11:52:32 +0200 Subject: [PATCH 50/57] Bump doctrine/orm to 3.6.2 for consistent dsn parsing --- composer.json | 2 +- pkg/dbal/DbalConnectionFactory.php | 33 +- .../Tests/DbalConnectionFactoryConfigTest.php | 597 ++++++------------ pkg/dbal/Tests/DbalConnectionFactoryTest.php | 31 +- 4 files changed, 221 insertions(+), 442 deletions(-) diff --git a/composer.json b/composer.json index 377b16215..4a4aa9614 100644 --- a/composer.json +++ b/composer.json @@ -20,12 +20,12 @@ "queue-interop/queue-interop": "^0.8.1", "bunny/bunny": "^0.5.5", "php-amqplib/php-amqplib": "^3.1", - "doctrine/dbal": "^3.2|^4.0", "ramsey/uuid": "^4.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "psr/container": "^1.1 || ^2.0", "makasim/temp-file": "^0.2", "google/cloud-pubsub": "^1.46", + "doctrine/dbal": "^3.6.2|^4.0", "doctrine/orm": "^2.20|^3.5", "doctrine/persistence": "^3.4|^4.1", "mongodb/mongodb": "^1.17", diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index 735818a46..e8922eb29 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -147,33 +147,22 @@ private function parseDsn(string $dsn, ?array $config = null): array ]; } - if (class_exists(DsnParser::class)) { // DBAL >= 4 - if ($dsnHasProtocolOnly) { - $dsn = $parsedDsn->getScheme().'://root@localhost'; - } - - $dsnParser = new DsnParser($supported); - - // replace scheme with the matching one from the supported list, but the prefixes there are "pdo-" not "pdo_" - $dsn = preg_replace( - '/^'.preg_quote($parsedDsn->getScheme(), '/').'(:|:\/\/)/', - str_replace('_', '-', $supported[$parsedDsn->getScheme()]).'$1', - $dsn, - ); - - return [ - 'lazy' => true, - 'connection' => $dsnParser->parse($dsn), - ]; + if ($dsnHasProtocolOnly) { + $dsn = $parsedDsn->getScheme().'://root@localhost'; } - $dsn = $dsnHasProtocolOnly ? - $doctrineScheme.'://root@localhost' : - str_replace($parsedDsn->getScheme(), $doctrineScheme, $dsn); + $dsnParser = new DsnParser($supported); + + // replace scheme with the matching one from the supported list, but the prefixes there are "pdo-" not "pdo_" + $dsn = preg_replace( + '/^'.preg_quote($parsedDsn->getScheme(), '/').'(:|:\/\/)/', + str_replace('_', '-', $supported[$parsedDsn->getScheme()]).'$1', + $dsn, + ); return [ 'lazy' => true, - 'connection' => ['url' => $dsn], + 'connection' => $dsnParser->parse($dsn), ]; } } diff --git a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php index 14f67cf8c..9c5189474 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php @@ -2,7 +2,6 @@ namespace Enqueue\Dbal\Tests; -use Doctrine\DBAL\Connection; use Enqueue\Dbal\DbalConnectionFactory; use Enqueue\Test\ClassExtensionTrait; use Enqueue\Test\ReadAttributeTrait; @@ -53,396 +52,210 @@ public function testShouldParseConfigurationAsExpected($config, $expectedConfig) public static function provideConfigs() { - // TODO: remove check when dropping support for DBAL < 4 - if ( - method_exists(Connection::class, 'connect') - && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() - ) { - // DBAL < 4 - - yield [ - null, - [ - 'connection' => [ - 'url' => 'pdo_mysql://root@localhost', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql:', - [ - 'connection' => [ - 'url' => 'pdo_mysql://root@localhost', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql+pdo:', - [ - 'connection' => [ - 'url' => 'pdo_mysql://root@localhost', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'pgsql:', - [ - 'connection' => [ - 'url' => 'pgsql://root@localhost', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo:', - 'connection' => [ - 'dbname' => 'customDbName', - ], - ], - [ - 'connection' => [ - 'dbname' => 'customDbName', - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'port' => '3306', - 'user' => 'root', - 'password' => '', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo:', - 'connection' => [ - 'dbname' => 'customDbName', - 'host' => 'host', - 'port' => '10000', - 'user' => 'user', - 'password' => 'pass', - ], - ], - [ - 'connection' => [ - 'dbname' => 'customDbName', - 'host' => 'host', - 'port' => '10000', - 'user' => 'user', - 'password' => 'pass', - 'driver' => 'pdo_mysql', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo://user:pass@host:10000/db', - 'connection' => [ - 'foo' => 'fooValue', - ], - ], - [ - 'connection' => [ - 'foo' => 'fooValue', - 'url' => 'pdo_mysql://user:pass@host:10000/db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql://user:pass@host:10000/db', - [ - 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10000/db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql+pdo://user:pass@host:10001/db', - [ - 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10001/db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [], - [ - 'connection' => [ - 'url' => 'pdo_mysql://root@localhost', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], - 'table_name' => 'a_queue_table', - ], - [ - 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], - 'table_name' => 'a_queue_table', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], - [ - 'connection' => [ - 'url' => 'pdo_mysql://user:pass@host:10001/db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - 'foo' => 'fooVal', - ], - ]; - } else { - // DBAL >= 4 - - yield [ - null, - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql:', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql+pdo:', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'pgsql:', - [ - 'connection' => [ - 'driver' => 'pgsql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo:', - 'connection' => [ - 'dbname' => 'customDbName', - ], - ], - [ - 'connection' => [ - 'dbname' => 'customDbName', - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'port' => '3306', - 'user' => 'root', - 'password' => '', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo:', - 'connection' => [ - 'dbname' => 'customDbName', - 'host' => 'host', - 'port' => '10000', - 'user' => 'user', - 'password' => 'pass', - ], - ], - [ - 'connection' => [ - 'dbname' => 'customDbName', - 'host' => 'host', - 'port' => '10000', - 'user' => 'user', - 'password' => 'pass', - 'driver' => 'pdo_mysql', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'dsn' => 'mysql+pdo://user:pass@host:10000/db', - 'connection' => [ - 'foo' => 'fooValue', - ], - ], - [ - 'connection' => [ - 'foo' => 'fooValue', - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10000, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql://user:pass@host:10000/db', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10000, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - 'mysql+pdo://user:pass@host:10001/db', - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10001, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [], - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'localhost', - 'user' => 'root', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - [ - 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], - 'table_name' => 'a_queue_table', - ], - [ - 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], - 'table_name' => 'a_queue_table', - 'polling_interval' => 1000, - 'lazy' => true, - ], - ]; - - yield [ - ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], - [ - 'connection' => [ - 'driver' => 'pdo_mysql', - 'host' => 'host', - 'port' => 10001, - 'user' => 'user', - 'password' => 'pass', - 'dbname' => 'db', - ], - 'table_name' => 'enqueue', - 'polling_interval' => 1000, - 'lazy' => true, - 'foo' => 'fooVal', - ], - ]; - } + yield [ + null, + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql:', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql+pdo:', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'pgsql:', + [ + 'connection' => [ + 'driver' => 'pgsql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo:', + 'connection' => [ + 'dbname' => 'customDbName', + ], + ], + [ + 'connection' => [ + 'dbname' => 'customDbName', + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'port' => '3306', + 'user' => 'root', + 'password' => '', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo:', + 'connection' => [ + 'dbname' => 'customDbName', + 'host' => 'host', + 'port' => '10000', + 'user' => 'user', + 'password' => 'pass', + ], + ], + [ + 'connection' => [ + 'dbname' => 'customDbName', + 'host' => 'host', + 'port' => '10000', + 'user' => 'user', + 'password' => 'pass', + 'driver' => 'pdo_mysql', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'dsn' => 'mysql+pdo://user:pass@host:10000/db', + 'connection' => [ + 'foo' => 'fooValue', + ], + ], + [ + 'connection' => [ + 'foo' => 'fooValue', + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10000, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql://user:pass@host:10000/db', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10000, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + 'mysql+pdo://user:pass@host:10001/db', + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10001, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [], + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'localhost', + 'user' => 'root', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + [ + 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], + 'table_name' => 'a_queue_table', + ], + [ + 'connection' => ['foo' => 'fooVal', 'bar' => 'barVal'], + 'table_name' => 'a_queue_table', + 'polling_interval' => 1000, + 'lazy' => true, + ], + ]; + + yield [ + ['dsn' => 'mysql+pdo://user:pass@host:10001/db', 'foo' => 'fooVal'], + [ + 'connection' => [ + 'driver' => 'pdo_mysql', + 'host' => 'host', + 'port' => 10001, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', + ], + 'table_name' => 'enqueue', + 'polling_interval' => 1000, + 'lazy' => true, + 'foo' => 'fooVal', + ], + ]; } } diff --git a/pkg/dbal/Tests/DbalConnectionFactoryTest.php b/pkg/dbal/Tests/DbalConnectionFactoryTest.php index 76b34c834..c2bd94502 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryTest.php @@ -2,7 +2,6 @@ namespace Enqueue\Dbal\Tests; -use Doctrine\DBAL\Connection; use Enqueue\Dbal\DbalConnectionFactory; use Enqueue\Dbal\DbalContext; use Enqueue\Test\ClassExtensionTrait; @@ -43,19 +42,8 @@ public function testShouldParseGenericDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - // TODO: remove check when dropping support for DBAL < 4 - if ( - method_exists(Connection::class, 'connect') - && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() - ) { - // DBAL < 4 - $this->assertArrayHasKey('url', $config['connection']); - $this->assertEquals('pdo_pgsql://foo@bar', $config['connection']['url']); - } else { - // DBAL >= 4 - $this->assertArrayHasKey('driver', $config['connection']); - $this->assertEquals('pdo_pgsql', $config['connection']['driver']); - } + $this->assertArrayHasKey('driver', $config['connection']); + $this->assertEquals('pdo_pgsql', $config['connection']['driver']); } public function testShouldParseSqliteAbsolutePathDSN() @@ -69,18 +57,7 @@ public function testShouldParseSqliteAbsolutePathDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - // TODO: remove check when dropping support for DBAL < 4 - if ( - method_exists(Connection::class, 'connect') - && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() - ) { - // DBAL < 4 - $this->assertArrayHasKey('url', $config['connection']); - $this->assertEquals('pdo_sqlite:////tmp/some.sq3', $config['connection']['url']); - } else { - // DBAL >= 4 - $this->assertArrayHasKey('path', $config['connection']); - $this->assertEquals('/tmp/some.sq3', $config['connection']['path']); - } + $this->assertArrayHasKey('path', $config['connection']); + $this->assertEquals('/tmp/some.sq3', $config['connection']['path']); } } From ca61adf6b751c052506c754b09ea88a4c37636a7 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 18:00:30 +0200 Subject: [PATCH 51/57] Fix dbal compat --- pkg/dbal/DbalConsumerHelperTrait.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/dbal/DbalConsumerHelperTrait.php b/pkg/dbal/DbalConsumerHelperTrait.php index 821eeac7c..b15b998b2 100644 --- a/pkg/dbal/DbalConsumerHelperTrait.php +++ b/pkg/dbal/DbalConsumerHelperTrait.php @@ -4,6 +4,7 @@ namespace Enqueue\Dbal; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Exception\RetryableException; use Ramsey\Uuid\Uuid; @@ -37,7 +38,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa ->andWhere('delivery_id IS NULL') ->addOrderBy('priority', 'asc') ->addOrderBy('published_at', 'asc') - ->setParameter('queues', $queues, Connection::PARAM_STR_ARRAY) + ->setParameter('queues', $queues, ArrayParameterType::STRING) ->setParameter('delayedUntil', $now, DbalType::INTEGER) ->setMaxResults(1); From e2847dd044334c02c9c720f1d0c7f986b497b6e3 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 19:46:46 +0200 Subject: [PATCH 52/57] Bump ratchet/pawl to ^0.4.3 for guzzle api consistency --- composer.json | 1 + pkg/monitoring/composer.json | 5 +++-- pkg/wamp/composer.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 4a4aa9614..ebe1ca471 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ "predis/predis": "^2.1", "thruway/client": "^0.5.5", "thruway/pawl-transport": "^0.5.2", + "ratchet/pawl": "^0.4.3", "influxdb/influxdb-php": "^1.14", "datadog/php-datadogstatsd": "^1.3", "guzzlehttp/guzzle": "^7.0.1", diff --git a/pkg/monitoring/composer.json b/pkg/monitoring/composer.json index 13b57a5f2..edf7b999f 100644 --- a/pkg/monitoring/composer.json +++ b/pkg/monitoring/composer.json @@ -16,8 +16,9 @@ "influxdb/influxdb-php": "^1.14", "datadog/php-datadogstatsd": "^1.3", "thruway/client": "^0.5.5", - "thruway/pawl-transport": "^0.5", - "voryx/thruway-common": "^1.0.1" + "thruway/pawl-transport": "^0.5.2", + "voryx/thruway-common": "^1.0.1", + "ratchet/pawl": "^0.4.3" }, "suggest": { "thruway/client": "Client for Thruway and the WAMP (Web Application Messaging Protocol).", diff --git a/pkg/wamp/composer.json b/pkg/wamp/composer.json index b510627bd..dc7e10ea6 100644 --- a/pkg/wamp/composer.json +++ b/pkg/wamp/composer.json @@ -10,8 +10,9 @@ "queue-interop/queue-interop": "^0.8.1", "enqueue/dsn": "^0.10.8", "thruway/client": "^0.5.5", - "thruway/pawl-transport": "^0.5.1", + "thruway/pawl-transport": "^0.5.2", "voryx/thruway-common": "^1.0.1", + "ratchet/pawl": "^0.4.3", "react/dns": "^1.4", "react/event-loop": "^1.2", "react/promise": "^2.8" From 793fdb0e3c0baba157ce9106b8328fa056e75cc7 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 19:59:42 +0200 Subject: [PATCH 53/57] Bump ratchet/rfc6455 to ^0.4 for api consistency --- composer.json | 1 + pkg/monitoring/composer.json | 3 ++- pkg/wamp/composer.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ebe1ca471..751569a2d 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "thruway/client": "^0.5.5", "thruway/pawl-transport": "^0.5.2", "ratchet/pawl": "^0.4.3", + "ratchet/rfc6455": "^0.4.0", "influxdb/influxdb-php": "^1.14", "datadog/php-datadogstatsd": "^1.3", "guzzlehttp/guzzle": "^7.0.1", diff --git a/pkg/monitoring/composer.json b/pkg/monitoring/composer.json index edf7b999f..9dc9e3c6c 100644 --- a/pkg/monitoring/composer.json +++ b/pkg/monitoring/composer.json @@ -18,7 +18,8 @@ "thruway/client": "^0.5.5", "thruway/pawl-transport": "^0.5.2", "voryx/thruway-common": "^1.0.1", - "ratchet/pawl": "^0.4.3" + "ratchet/pawl": "^0.4.3", + "ratchet/rfc6455": "^0.4.0" }, "suggest": { "thruway/client": "Client for Thruway and the WAMP (Web Application Messaging Protocol).", diff --git a/pkg/wamp/composer.json b/pkg/wamp/composer.json index dc7e10ea6..3d260254f 100644 --- a/pkg/wamp/composer.json +++ b/pkg/wamp/composer.json @@ -13,6 +13,7 @@ "thruway/pawl-transport": "^0.5.2", "voryx/thruway-common": "^1.0.1", "ratchet/pawl": "^0.4.3", + "ratchet/rfc6455": "^0.4.0", "react/dns": "^1.4", "react/event-loop": "^1.2", "react/promise": "^2.8" From 174c9256776505165b957a17e624bd52d4633ba9 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 20 Dec 2025 20:12:42 +0200 Subject: [PATCH 54/57] Fix a signature --- pkg/enqueue-bundle/Tests/Functional/App/TestAsyncSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncSubscriber.php b/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncSubscriber.php index cd3beb45b..a52a9f7ab 100644 --- a/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncSubscriber.php +++ b/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncSubscriber.php @@ -14,7 +14,7 @@ public function onEvent($event, $eventName, EventDispatcherInterface $dispatcher $this->calls[] = func_get_args(); } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return ['test_async_subscriber' => 'onEvent']; } From 0e40e6e4f8d150aac97714484822ec90811f4ccd Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sun, 21 Dec 2025 20:07:33 +0200 Subject: [PATCH 55/57] Drop Symfony 6 --- .github/workflows/ci.yml | 4 ++-- 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 ++++---- 8 files changed, 50 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 715c94cf5..0b2d595ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: fail-fast: false matrix: php: ['8.2', '8.3', '8.4'] - symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] + symfony_version: ['7.3.*', '7.4.*', '8.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - php: '8.2' @@ -124,7 +124,7 @@ jobs: fail-fast: false matrix: php: ['8.2', '8.3', '8.4'] - symfony_version: ['6.4.*', '7.3.*', '7.4.*', '8.0.*'] + symfony_version: ['7.3.*', '7.4.*', '8.0.*'] dependencies: ['--prefer-lowest', '--prefer-dist'] exclude: - php: '8.2' diff --git a/composer.json b/composer.json index 751569a2d..e0870fa5d 100644 --- a/composer.json +++ b/composer.json @@ -55,18 +55,18 @@ "phpunit/phpunit": "^9.5.28", "phpstan/phpstan": "^1.0", "queue-interop/queue-spec": "^0.6.2", - "symfony/browser-kit": "^6.2|^7.0|^8.0", - "symfony/config": "^6.2|^7.0|^8.0", - "symfony/process": "^6.2|^7.0|^8.0", - "symfony/console": "^6.2|^7.0|^8.0", - "symfony/dependency-injection": "^6.2|^7.0|^8.0", - "symfony/event-dispatcher": "^6.2|^7.0|^8.0", - "symfony/expression-language": "^6.2|^7.0|^8.0", - "symfony/http-kernel": "^6.2|^7.0|^8.0", - "symfony/filesystem": "^6.2|^7.0|^8.0", - "symfony/framework-bundle": "^6.2|^7.0|^8.0", - "symfony/validator": "^6.2|^7.0|^8.0", - "symfony/yaml": "^6.2|^7.0|^8.0", + "symfony/browser-kit": "^7.0|^8.0", + "symfony/config": "^7.0|^8.0", + "symfony/process": "^7.0|^8.0", + "symfony/console": "^7.0|^8.0", + "symfony/dependency-injection": "^7.0|^8.0", + "symfony/event-dispatcher": "^7.0|^8.0", + "symfony/expression-language": "^7.0|^8.0", + "symfony/http-kernel": "^7.0|^8.0", + "symfony/filesystem": "^7.0|^8.0", + "symfony/framework-bundle": "^7.0|^8.0", + "symfony/validator": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.0", "empi89/php-amqp-stubs": "*@dev", "doctrine/doctrine-bundle": "^2.5|^3.1", "doctrine/mongodb-odm-bundle": "^4.7|^5.0", diff --git a/pkg/async-command/composer.json b/pkg/async-command/composer.json index 4fe65d7a7..1e5acfb1e 100644 --- a/pkg/async-command/composer.json +++ b/pkg/async-command/composer.json @@ -9,16 +9,16 @@ "php": "^8.1", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", - "symfony/console": "^6.2|^7.0|^8.0", - "symfony/process": "^6.2|^7.0|^8.0" + "symfony/console": "^7.0|^8.0", + "symfony/process": "^7.0|^8.0" }, "require-dev": { "phpunit/phpunit": "^9.5", - "symfony/dependency-injection": "^6.2|^7.0|^8.0", - "symfony/config": "^6.2|^7.0|^8.0", - "symfony/http-kernel": "^6.2|^7.0|^8.0", - "symfony/filesystem": "^6.2|^7.0|^8.0", - "symfony/yaml": "^6.2|^7.0|^8.0", + "symfony/dependency-injection": "^7.0|^8.0", + "symfony/config": "^7.0|^8.0", + "symfony/http-kernel": "^7.0|^8.0", + "symfony/filesystem": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.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": "^6.2|^7.0|^8.0 If you'd like to use async event dispatcher container extension." + "symfony/dependency-injection": "^7.0|^8.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 f78597af4..8c78dad4d 100644 --- a/pkg/async-event-dispatcher/composer.json +++ b/pkg/async-event-dispatcher/composer.json @@ -9,15 +9,15 @@ "php": "^8.1", "enqueue/enqueue": "^0.10", "queue-interop/queue-interop": "^0.8", - "symfony/event-dispatcher": "^5.4|^6.0" + "symfony/event-dispatcher": "^7.0|^8.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": "^7.0|^8.0", + "symfony/config": "^7.0|^8.0", + "symfony/http-kernel": "^7.0|^8.0", + "symfony/filesystem": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.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": "^7.0|^8.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 6c5638c43..074996a98 100644 --- a/pkg/enqueue-bundle/composer.json +++ b/pkg/enqueue-bundle/composer.json @@ -7,7 +7,7 @@ "license": "MIT", "require": { "php": "^8.1", - "symfony/framework-bundle": "^6.2|^7.0", + "symfony/framework-bundle": "^7.0|^8.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.5|^3.1", "doctrine/mongodb-odm-bundle": "^3.5|^4.3|^5.0", "alcaeus/mongo-php-adapter": "^1.0", - "symfony/browser-kit": "^6.2|^7.0", - "symfony/expression-language": "^6.2|^7.0", - "symfony/validator": "^6.2|^7.0", - "symfony/yaml": "^6.2|^7.0" + "symfony/browser-kit": "^7.0|^8.0", + "symfony/expression-language": "^7.0|^8.0", + "symfony/validator": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.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 c336c4bad..db85e0bcb 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": "^7.0|^8.0", + "symfony/dependency-injection": "^7.0|^8.0", + "symfony/config": "^7.0|^8.0", + "symfony/event-dispatcher": "^7.0|^8.0", + "symfony/http-kernel": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.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": "^7.0|^8.0 If you want to use cli commands", + "symfony/dependency-injection": "^7.0|^8.0", + "symfony/config": "^7.0|^8.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 4dd2ff806..f84bc6932 100644 --- a/pkg/fs/composer.json +++ b/pkg/fs/composer.json @@ -9,7 +9,7 @@ "php": "^8.1", "queue-interop/queue-interop": "^0.8", "enqueue/dsn": "^0.10", - "symfony/filesystem": "^5.4|^6.0", + "symfony/filesystem": "^7.0|^8.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": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.0" }, "support": { "email": "opensource@forma-pro.com", diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index fec589eeb..4570694b5 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.5|^3.1", - "symfony/browser-kit": "^6.2|^7.0|^8.0", - "symfony/expression-language": "^6.2|^7.0|^8.0", - "symfony/framework-bundle": "^6.2|^7.0|^8.0", - "symfony/yaml": "^6.2|^7.0|^8.0" + "symfony/browser-kit": "^7.0|^8.0", + "symfony/expression-language": "^7.0|^8.0", + "symfony/framework-bundle": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.0" }, "support": { "email": "opensource@forma-pro.com", From 03fc6ffd91c801f7e4b73cdcd1741f6770524e51 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sun, 21 Dec 2025 20:13:12 +0200 Subject: [PATCH 56/57] Move to ramsey/composer-install@v3 --- .github/workflows/ci.yml | 50 ++++--------------- pkg/amqp-bunny/.github/workflows/ci.yml | 2 +- pkg/amqp-ext/.github/workflows/ci.yml | 2 +- pkg/amqp-lib/.github/workflows/ci.yml | 2 +- pkg/amqp-tools/.github/workflows/ci.yml | 2 +- pkg/async-command/.github/workflows/ci.yml | 2 +- .../.github/workflows/ci.yml | 2 +- pkg/dbal/.github/workflows/ci.yml | 2 +- pkg/dsn/.github/workflows/ci.yml | 2 +- pkg/enqueue-bundle/.github/workflows/ci.yml | 2 +- pkg/enqueue/.github/workflows/ci.yml | 2 +- pkg/fs/.github/workflows/ci.yml | 2 +- pkg/gearman/.github/workflows/ci.yml | 2 +- pkg/gps/.github/workflows/ci.yml | 2 +- pkg/job-queue/.github/workflows/ci.yml | 2 +- pkg/mongodb/.github/workflows/ci.yml | 2 +- pkg/monitoring/.github/workflows/ci.yml | 2 +- pkg/null/.github/workflows/ci.yml | 2 +- pkg/pheanstalk/.github/workflows/ci.yml | 2 +- pkg/rdkafka/.github/workflows/ci.yml | 2 +- pkg/redis/.github/workflows/ci.yml | 2 +- pkg/sns/.github/workflows/ci.yml | 2 +- pkg/snsqs/.github/workflows/ci.yml | 2 +- pkg/sqs/.github/workflows/ci.yml | 2 +- pkg/stomp/.github/workflows/ci.yml | 2 +- pkg/wamp/.github/workflows/ci.yml | 2 +- 26 files changed, 34 insertions(+), 66 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b2d595ca..0c9ba3ced 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,18 +44,6 @@ jobs: PATTERNS: | pkg/**/*.php - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: composer-cs-check-${{ hashFiles('**/composer.json') }} - restore-keys: | - composer-cs-check- - - uses: shivammathur/setup-php@v2 with: php-version: '8.2' @@ -65,7 +53,7 @@ jobs: - run: php ./bin/fix-symfony-version.php "7.4.*" - - run: composer update --no-progress + - uses: "ramsey/composer-install@v3" - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php @@ -79,7 +67,7 @@ jobs: matrix: php: ['8.2', '8.3', '8.4'] symfony_version: ['7.3.*', '7.4.*', '8.0.*'] - dependencies: ['--prefer-lowest', '--prefer-dist'] + dependencies: ['lowest', 'highest'] exclude: - php: '8.2' symfony_version: '8.0.*' @@ -91,18 +79,6 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} - restore-keys: | - composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}- - - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -112,7 +88,9 @@ jobs: - run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}" - - run: composer update --no-progress ${{ matrix.dependencies }} + - uses: "ramsey/composer-install@v3" + with: + dependency-versions: "${{ matrix.dependencies }}" - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php @@ -125,7 +103,7 @@ jobs: matrix: php: ['8.2', '8.3', '8.4'] symfony_version: ['7.3.*', '7.4.*', '8.0.*'] - dependencies: ['--prefer-lowest', '--prefer-dist'] + dependencies: ['lowest', 'highest'] exclude: - php: '8.2' symfony_version: '8.0.*' @@ -137,18 +115,6 @@ jobs: steps: - uses: actions/checkout@v6 - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} - restore-keys: | - composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}- - - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -158,7 +124,9 @@ jobs: - run: php ./bin/fix-symfony-version.php "${{ matrix.symfony_version }}" - - run: composer update --no-progress ${{ matrix.dependencies }} + - uses: "ramsey/composer-install@v3" + with: + dependency-versions: "${{ matrix.dependencies }}" - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php diff --git a/pkg/amqp-bunny/.github/workflows/ci.yml b/pkg/amqp-bunny/.github/workflows/ci.yml index e2e4f9400..ce80335de 100644 --- a/pkg/amqp-bunny/.github/workflows/ci.yml +++ b/pkg/amqp-bunny/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: vendor/bin/phpunit --exclude-group=functional diff --git a/pkg/amqp-ext/.github/workflows/ci.yml b/pkg/amqp-ext/.github/workflows/ci.yml index 530b82994..232e9050c 100644 --- a/pkg/amqp-ext/.github/workflows/ci.yml +++ b/pkg/amqp-ext/.github/workflows/ci.yml @@ -24,6 +24,6 @@ jobs: - run: php Tests/fix_composer_json.php - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: vendor/bin/phpunit --exclude-group=functional diff --git a/pkg/amqp-lib/.github/workflows/ci.yml b/pkg/amqp-lib/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/amqp-lib/.github/workflows/ci.yml +++ b/pkg/amqp-lib/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/amqp-tools/.github/workflows/ci.yml b/pkg/amqp-tools/.github/workflows/ci.yml index e2e4f9400..ce80335de 100644 --- a/pkg/amqp-tools/.github/workflows/ci.yml +++ b/pkg/amqp-tools/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: vendor/bin/phpunit --exclude-group=functional diff --git a/pkg/async-command/.github/workflows/ci.yml b/pkg/async-command/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/async-command/.github/workflows/ci.yml +++ b/pkg/async-command/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/async-event-dispatcher/.github/workflows/ci.yml b/pkg/async-event-dispatcher/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/async-event-dispatcher/.github/workflows/ci.yml +++ b/pkg/async-event-dispatcher/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/dbal/.github/workflows/ci.yml b/pkg/dbal/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/dbal/.github/workflows/ci.yml +++ b/pkg/dbal/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/dsn/.github/workflows/ci.yml b/pkg/dsn/.github/workflows/ci.yml index 4bbfaeb39..6903ec1e3 100644 --- a/pkg/dsn/.github/workflows/ci.yml +++ b/pkg/dsn/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/enqueue-bundle/.github/workflows/ci.yml b/pkg/enqueue-bundle/.github/workflows/ci.yml index 029f841a1..5d5ab2fa8 100644 --- a/pkg/enqueue-bundle/.github/workflows/ci.yml +++ b/pkg/enqueue-bundle/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - run: php Tests/fix_composer_json.php - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/enqueue/.github/workflows/ci.yml b/pkg/enqueue/.github/workflows/ci.yml index 6e34448f2..faaaaf9f3 100644 --- a/pkg/enqueue/.github/workflows/ci.yml +++ b/pkg/enqueue/.github/workflows/ci.yml @@ -25,6 +25,6 @@ jobs: - run: php Tests/fix_composer_json.php - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: vendor/bin/phpunit --exclude-group=functional diff --git a/pkg/fs/.github/workflows/ci.yml b/pkg/fs/.github/workflows/ci.yml index 5c20f9451..bbfcd19d5 100644 --- a/pkg/fs/.github/workflows/ci.yml +++ b/pkg/fs/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/gearman/.github/workflows/ci.yml b/pkg/gearman/.github/workflows/ci.yml index 2d3ee49f1..668c25b7f 100644 --- a/pkg/gearman/.github/workflows/ci.yml +++ b/pkg/gearman/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: coverage: none extensions: gearman - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/gps/.github/workflows/ci.yml b/pkg/gps/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/gps/.github/workflows/ci.yml +++ b/pkg/gps/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/job-queue/.github/workflows/ci.yml b/pkg/job-queue/.github/workflows/ci.yml index 3e9ffb514..e6b79cb2d 100644 --- a/pkg/job-queue/.github/workflows/ci.yml +++ b/pkg/job-queue/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-dist" diff --git a/pkg/mongodb/.github/workflows/ci.yml b/pkg/mongodb/.github/workflows/ci.yml index a0decabb6..3bedbd6ff 100644 --- a/pkg/mongodb/.github/workflows/ci.yml +++ b/pkg/mongodb/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: coverage: none extensions: mongodb - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/monitoring/.github/workflows/ci.yml b/pkg/monitoring/.github/workflows/ci.yml index e2e4f9400..ce80335de 100644 --- a/pkg/monitoring/.github/workflows/ci.yml +++ b/pkg/monitoring/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: vendor/bin/phpunit --exclude-group=functional diff --git a/pkg/null/.github/workflows/ci.yml b/pkg/null/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/null/.github/workflows/ci.yml +++ b/pkg/null/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/pheanstalk/.github/workflows/ci.yml b/pkg/pheanstalk/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/pheanstalk/.github/workflows/ci.yml +++ b/pkg/pheanstalk/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/rdkafka/.github/workflows/ci.yml b/pkg/rdkafka/.github/workflows/ci.yml index d589081e5..928d46fa9 100644 --- a/pkg/rdkafka/.github/workflows/ci.yml +++ b/pkg/rdkafka/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: # ext-rdkafka not needed for tests, and a pain to install on CI; composer-options: "--ignore-platform-req=ext-rdkafka" diff --git a/pkg/redis/.github/workflows/ci.yml b/pkg/redis/.github/workflows/ci.yml index 9b88b361f..e33e0628c 100644 --- a/pkg/redis/.github/workflows/ci.yml +++ b/pkg/redis/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: coverage: none extensions: redis - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/sns/.github/workflows/ci.yml b/pkg/sns/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/sns/.github/workflows/ci.yml +++ b/pkg/sns/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/snsqs/.github/workflows/ci.yml b/pkg/snsqs/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/snsqs/.github/workflows/ci.yml +++ b/pkg/snsqs/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/sqs/.github/workflows/ci.yml b/pkg/sqs/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/sqs/.github/workflows/ci.yml +++ b/pkg/sqs/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/stomp/.github/workflows/ci.yml b/pkg/stomp/.github/workflows/ci.yml index 887ff0eba..c91cb39ab 100644 --- a/pkg/stomp/.github/workflows/ci.yml +++ b/pkg/stomp/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" with: composer-options: "--prefer-source" diff --git a/pkg/wamp/.github/workflows/ci.yml b/pkg/wamp/.github/workflows/ci.yml index e2e4f9400..ce80335de 100644 --- a/pkg/wamp/.github/workflows/ci.yml +++ b/pkg/wamp/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: php-version: ${{ matrix.php }} coverage: none - - uses: "ramsey/composer-install@v1" + - uses: "ramsey/composer-install@v3" - run: vendor/bin/phpunit --exclude-group=functional From 2c7f63709dd9f33f99fde106da243cd2eeaf906e Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Sun, 21 Dec 2025 21:52:33 +0200 Subject: [PATCH 57/57] release 0.10.27 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe4ddabbd..1a3301ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## [0.10.27](https://github.com/php-enqueue/enqueue-dev/tree/0.10.27) (2025-12-21) +[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.10.26...0.10.27) + +**Merged pull requests:** + +- Support PHP 8.3–8.4 and Symfony 7.3–8.0 [\#1397](https://github.com/php-enqueue/enqueue-dev/pull/1397) ([andrewmy](https://github.com/andrewmy)) +- add symfony 7 support + adjust CI for simple-client package [\#1391](https://github.com/php-enqueue/enqueue-dev/pull/1391) ([LordSimal](https://github.com/LordSimal)) + ## [0.10.26](https://github.com/php-enqueue/enqueue-dev/tree/0.10.26) (2025-05-10) [Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.10.25...0.10.26)