From db82ab68badb2c856ff2b175bba8d0899e30dae3 Mon Sep 17 00:00:00 2001 From: Andrejs M-J Date: Sat, 29 Nov 2025 11:33:15 +0100 Subject: [PATCH 01/21] 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 02/21] 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 03/21] 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 04/21] 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 05/21] 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 06/21] 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 07/21] 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 08/21] 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 09/21] 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 10/21] 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 11/21] 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 12/21] 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 13/21] 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 14/21] 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 15/21] 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 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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); - } }