diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36c3d5d90..0c9ba3ced 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@v6 - - uses: technote-space/get-diff-action@v4 + - uses: technote-space/get-diff-action@v6 with: PATTERNS: | pkg/**/*.php @@ -23,9 +23,9 @@ 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@v1" + - uses: "ramsey/composer-install@v3" - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php @@ -37,25 +37,13 @@ jobs: name: Code style check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - - uses: technote-space/get-diff-action@v4 + - uses: technote-space/get-diff-action@v6 with: 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@v2 - 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' @@ -63,9 +51,9 @@ 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 + - uses: "ramsey/composer-install@v3" - run: sed -i 's/525568/16777471/' vendor/kwn/php-rdkafka-stubs/stubs/constants.php @@ -77,29 +65,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2'] - symfony_version: ['6.2.*', '6.3.*', '6.4.*', '7.0.*'] - dependencies: ['--prefer-lowest', '--prefer-dist'] + php: ['8.2', '8.3', '8.4'] + symfony_version: ['7.3.*', '7.4.*', '8.0.*'] + dependencies: ['lowest', 'highest'] exclude: - - php: '8.1' - symfony_version: '7.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@v2 - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v2 - 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: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -110,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 @@ -121,29 +101,19 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.1', '8.2' ] - symfony_version: [ '6.2.*', '6.3.*', '6.4.*', '7.0.*' ] - dependencies: [ '--prefer-lowest', '--prefer-dist' ] + php: ['8.2', '8.3', '8.4'] + symfony_version: ['7.3.*', '7.4.*', '8.0.*'] + dependencies: ['lowest', 'highest'] exclude: - - php: '8.1' - symfony_version: '7.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@v2 - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v2 - 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: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -154,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 @@ -162,10 +134,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/CHANGELOG.md b/CHANGELOG.md index 4643cc9c9..1a3301ad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # 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) + +**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) + +**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) 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/composer.json b/composer.json index d2258474d..e0870fa5d 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", @@ -13,35 +13,37 @@ "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", "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", + "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", - "doctrine/orm": "^2.12", - "doctrine/persistence": "^2.0|^3.0", - "mongodb/mongodb": "^1.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", "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", + "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", - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^2.4.5", "php-http/discovery": "^1.13", "voryx/thruway-common": "^1.0.1", "react/dns": "^1.4", @@ -50,24 +52,24 @@ }, "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", - "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": "^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.3.2", - "doctrine/mongodb-odm-bundle": "^3.5|^4.3|^5.0", + "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", "friendsofphp/php-cs-fixer": "^3.4", @@ -127,7 +129,7 @@ "ext-rdkafka": "4.0", "ext-bcmath": "1", "ext-mbstring": "1", - "ext-mongo": "1.6.14", + "ext-mongodb": "1.21", "ext-sockets": "1" }, "prefer-stable": true, 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..9e7a0b71b 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/.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 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/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/docker/bin/test.sh b/docker/bin/test.sh index b78e1c1a8..1a6d35453 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 @@ -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 @@ -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 "$@" 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 diff --git a/pkg/amqp-bunny/.github/workflows/ci.yml b/pkg/amqp-bunny/.github/workflows/ci.yml index 5448d7b1a..ce80335de 100644 --- a/pkg/amqp-bunny/.github/workflows/ci.yml +++ b/pkg/amqp-bunny/.github/workflows/ci.yml @@ -10,18 +10,18 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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-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/.github/workflows/ci.yml b/pkg/amqp-ext/.github/workflows/ci.yml index d48deb0af..232e9050c 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -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-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/.github/workflows/ci.yml b/pkg/amqp-lib/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/amqp-lib/.github/workflows/ci.yml +++ b/pkg/amqp-lib/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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-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/.github/workflows/ci.yml b/pkg/amqp-tools/.github/workflows/ci.yml index 5448d7b1a..ce80335de 100644 --- a/pkg/amqp-tools/.github/workflows/ci.yml +++ b/pkg/amqp-tools/.github/workflows/ci.yml @@ -10,18 +10,18 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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-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/.github/workflows/ci.yml b/pkg/async-command/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/async-command/.github/workflows/ci.yml +++ b/pkg/async-command/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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-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-command/composer.json b/pkg/async-command/composer.json index 48fd6f089..1e5acfb1e 100644 --- a/pkg/async-command/composer.json +++ b/pkg/async-command/composer.json @@ -6,19 +6,19 @@ "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", - "symfony/process": "^5.4|^6.0" + "symfony/console": "^7.0|^8.0", + "symfony/process": "^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" @@ -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": "^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/.github/workflows/ci.yml b/pkg/async-event-dispatcher/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/async-event-dispatcher/.github/workflows/ci.yml +++ b/pkg/async-event-dispatcher/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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); 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/async-event-dispatcher/composer.json b/pkg/async-event-dispatcher/composer.json index a2cef0d79..8c78dad4d 100644 --- a/pkg/async-event-dispatcher/composer.json +++ b/pkg/async-event-dispatcher/composer.json @@ -6,18 +6,18 @@ "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" + "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/dbal/.github/workflows/ci.yml b/pkg/dbal/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/dbal/.github/workflows/ci.yml +++ b/pkg/dbal/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index 305375a89..e8922eb29 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; @@ -86,7 +87,17 @@ private function establishConnection(): Connection { if (false == $this->connection) { $this->connection = DriverManager::getConnection($this->config['connection']); - $this->connection->connect(); + if ( + 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 { + // DBAL >= 4 + $this->connection->getServerVersion(); // calls connect() internally + } } return $this->connection; @@ -96,18 +107,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', ]; @@ -133,13 +147,22 @@ private function parseDsn(string $dsn, ?array $config = null): array ]; } + 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' => [ - 'url' => $dsnHasProtocolOnly ? - $doctrineScheme.'://root@localhost' : - str_replace($parsedDsn->getScheme(), $doctrineScheme, $dsn), - ], + 'connection' => $dsnParser->parse($dsn), ]; } } diff --git a/pkg/dbal/DbalConsumerHelperTrait.php b/pkg/dbal/DbalConsumerHelperTrait.php index 4a3d32997..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); @@ -53,7 +54,7 @@ protected function fetchMessage(array $queues, int $redeliveryDelay): ?DbalMessa while (microtime(true) < $endAt) { try { - $result = $select->execute()->fetch(); + $result = $select->executeQuery()->fetchAssociative(); if (empty($result)) { return null; } @@ -61,15 +62,15 @@ 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() - ->fetch(); + ->executeQuery() + ->fetchAssociative(); // the message has been removed by a 3rd party, such as truncate operation. if (false === $deliveredMessage) { @@ -108,7 +109,7 @@ protected function redeliverMessages(): void ; try { - $update->execute(); + $update->executeQuery(); $this->redeliverMessagesLastExecutedAt = microtime(true); } catch (RetryableException $e) { @@ -135,7 +136,7 @@ protected function removeExpiredMessages(): void ; try { - $delete->execute(); + $delete->executeQuery(); } catch (RetryableException $e) { // maybe next time we'll get more luck } 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/ManagerRegistryConnectionFactory.php b/pkg/dbal/ManagerRegistryConnectionFactory.php index 430633151..602a76762 100644 --- a/pkg/dbal/ManagerRegistryConnectionFactory.php +++ b/pkg/dbal/ManagerRegistryConnectionFactory.php @@ -59,8 +59,18 @@ public function close(): void private function establishConnection(): Connection { + /** @var Connection $connection */ $connection = $this->registry->getConnection($this->config['connection_name']); - $connection->connect(); + if ( + method_exists($connection, 'connect') + && (new \ReflectionMethod($connection, 'connect'))->isPublic() + ) { + // DBAL < 4 + $connection->connect(); + } else { + // DBAL >= 4, calls connect() internally + $connection->getServerVersion(); + } return $connection; } diff --git a/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php b/pkg/dbal/Tests/DbalConnectionFactoryConfigTest.php index 5929e1479..9c5189474 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, @@ -170,7 +183,12 @@ 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, + 'user' => 'user', + 'password' => 'pass', + 'dbname' => 'db', ], 'table_name' => 'enqueue', 'polling_interval' => 1000, @@ -182,7 +200,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 +217,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 +244,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..c2bd94502 100644 --- a/pkg/dbal/Tests/DbalConnectionFactoryTest.php +++ b/pkg/dbal/Tests/DbalConnectionFactoryTest.php @@ -41,8 +41,9 @@ 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 +56,8 @@ public function testShouldParseSqliteAbsolutePathDSN() $config = $context->getConfig(); $this->assertArrayHasKey('connection', $config); - $this->assertArrayHasKey('url', $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']); } } 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(); diff --git a/pkg/dbal/composer.json b/pkg/dbal/composer.json index a4d4af7f4..adc0b6c44 100644 --- a/pkg/dbal/composer.json +++ b/pkg/dbal/composer.json @@ -6,10 +6,10 @@ "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", + "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/dsn/.github/workflows/ci.yml b/pkg/dsn/.github/workflows/ci.yml index 71bcbbd61..6903ec1e3 100644 --- a/pkg/dsn/.github/workflows/ci.yml +++ b/pkg/dsn/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/composer.json b/pkg/dsn/composer.json index 94fb18a9f..dbd39aed7 100644 --- a/pkg/dsn/composer.json +++ b/pkg/dsn/composer.json @@ -6,7 +6,7 @@ "homepage": "https://enqueue.forma-pro.com/", "license": "MIT", "require": { - "php": "^7.4|^8.0" + "php": "^8.0" }, "require-dev": { "phpunit/phpunit": "^9.5" diff --git a/pkg/enqueue-bundle/.github/workflows/ci.yml b/pkg/enqueue-bundle/.github/workflows/ci.yml index 4c397bef1..5d5ab2fa8 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -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-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php index 7fd9527db..a33739870 100644 --- a/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php +++ b/pkg/enqueue-bundle/Consumption/Extension/DoctrinePingConnectionExtension.php @@ -36,7 +36,16 @@ public function onMessageReceived(MessageReceived $context): void ); $connection->close(); - $connection->connect(); + if ( + method_exists($connection, 'connect') + && (new \ReflectionMethod($connection, 'connect'))->isPublic() + ) { + // 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/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/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/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']; } 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/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php index 36df82e52..b690fa290 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php @@ -41,10 +41,19 @@ public function testShouldNotReconnectIfConnectionIsOK() ->expects($this->never()) ->method('close') ; - $connection - ->expects($this->never()) - ->method('connect') - ; + if ( + method_exists(Connection::class, 'connect') + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { + // 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 +90,18 @@ public function testShouldDoesReconnectIfConnectionFailed() ->expects($this->once()) ->method('close') ; - $connection - ->expects($this->once()) - ->method('connect') - ; + if ( + method_exists(Connection::class, 'connect') + && (new \ReflectionMethod(Connection::class, 'connect'))->isPublic() + ) { + // DBAL < 4 + $connection->expects($this->once()) + ->method('connect'); + } else { + // DBAL >= 4, calls connect() internally + $connection->expects($this->once()) + ->method('getServerVersion'); + } $context = $this->createContext(); diff --git a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php index 63282a255..e0d96fafa 100644 --- a/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; -use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter; +use Symfony\Contracts\Service\ResetInterface; class ResetServicesExtensionTest extends TestCase { @@ -50,8 +50,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); } } diff --git a/pkg/enqueue-bundle/composer.json b/pkg/enqueue-bundle/composer.json index 99d237bf6..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", @@ -36,13 +36,13 @@ "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", - "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/.github/workflows/ci.yml b/pkg/enqueue/.github/workflows/ci.yml index 28a46e908..faaaaf9f3 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -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/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/Consumption/Extension/LogExtension.php b/pkg/enqueue/Consumption/Extension/LogExtension.php index 14383c4d1..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}\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, 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/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'), 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(); 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(); diff --git a/pkg/enqueue/composer.json b/pkg/enqueue/composer.json index 0da00ee4b..db85e0bcb 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", @@ -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/.github/workflows/ci.yml b/pkg/fs/.github/workflows/ci.yml index 65cfbbb2d..bbfcd19d5 100644 --- a/pkg/fs/.github/workflows/ci.yml +++ b/pkg/fs/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/fs/composer.json b/pkg/fs/composer.json index b44900541..f84bc6932 100644 --- a/pkg/fs/composer.json +++ b/pkg/fs/composer.json @@ -6,10 +6,10 @@ "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", + "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/gearman/.github/workflows/ci.yml b/pkg/gearman/.github/workflows/ci.yml index 28ae81b0f..668c25b7f 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -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/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/.github/workflows/ci.yml b/pkg/gps/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/gps/.github/workflows/ci.yml +++ b/pkg/gps/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/.github/workflows/ci.yml b/pkg/job-queue/.github/workflows/ci.yml index 28a9a9c02..e6b79cb2d 100644 --- a/pkg/job-queue/.github/workflows/ci.yml +++ b/pkg/job-queue/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/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; } /** 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); }) 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 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: diff --git a/pkg/job-queue/composer.json b/pkg/job-queue/composer.json index 55d37d5da..4570694b5 100644 --- a/pkg/job-queue/composer.json +++ b/pkg/job-queue/composer.json @@ -6,21 +6,21 @@ "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", "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", - "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" + "doctrine/doctrine-bundle": "^2.5|^3.1", + "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", diff --git a/pkg/mongodb/.github/workflows/ci.yml b/pkg/mongodb/.github/workflows/ci.yml index 415baf634..3bedbd6ff 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -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/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/.github/workflows/ci.yml b/pkg/monitoring/.github/workflows/ci.yml index 5448d7b1a..ce80335de 100644 --- a/pkg/monitoring/.github/workflows/ci.yml +++ b/pkg/monitoring/.github/workflows/ci.yml @@ -10,18 +10,18 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/monitoring/composer.json b/pkg/monitoring/composer.json index e19da2fa9..9dc9e3c6c 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" }, @@ -16,8 +16,10 @@ "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", + "ratchet/rfc6455": "^0.4.0" }, "suggest": { "thruway/client": "Client for Thruway and the WAMP (Web Application Messaging Protocol).", diff --git a/pkg/null/.github/workflows/ci.yml b/pkg/null/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/null/.github/workflows/ci.yml +++ b/pkg/null/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/.github/workflows/ci.yml b/pkg/pheanstalk/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/pheanstalk/.github/workflows/ci.yml +++ b/pkg/pheanstalk/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/.github/workflows/ci.yml b/pkg/rdkafka/.github/workflows/ci.yml index 9e0ceb121..928d46fa9 100644 --- a/pkg/rdkafka/.github/workflows/ci.yml +++ b/pkg/rdkafka/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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 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/.github/workflows/ci.yml b/pkg/redis/.github/workflows/ci.yml index 57d501bee..e33e0628c 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: @@ -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/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) { 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/.github/workflows/ci.yml b/pkg/simple-client/.github/workflows/ci.yml index 6b24b0f30..6bf7ab71b 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.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - 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 7cb07b6b3..03bda03b4 100644 --- a/pkg/simple-client/composer.json +++ b/pkg/simple-client/composer.json @@ -6,11 +6,11 @@ "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", - "symfony/config": "^5.4|^6.0" + "symfony/config": "^6.0|^7.0" }, "require-dev": { "phpunit/phpunit": "^9.5", diff --git a/pkg/sns/.github/workflows/ci.yml b/pkg/sns/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/sns/.github/workflows/ci.yml +++ b/pkg/sns/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/.github/workflows/ci.yml b/pkg/snsqs/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/snsqs/.github/workflows/ci.yml +++ b/pkg/snsqs/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/.github/workflows/ci.yml b/pkg/sqs/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/sqs/.github/workflows/ci.yml +++ b/pkg/sqs/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/.github/workflows/ci.yml b/pkg/stomp/.github/workflows/ci.yml index 0492424e8..c91cb39ab 100644 --- a/pkg/stomp/.github/workflows/ci.yml +++ b/pkg/stomp/.github/workflows/ci.yml @@ -10,19 +10,19 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/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/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( diff --git a/pkg/wamp/.github/workflows/ci.yml b/pkg/wamp/.github/workflows/ci.yml index 5448d7b1a..ce80335de 100644 --- a/pkg/wamp/.github/workflows/ci.yml +++ b/pkg/wamp/.github/workflows/ci.yml @@ -10,18 +10,18 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4', '8.0', '8.1', '8.2'] + php: ['8.2', '8.3', '8.4'] name: PHP ${{ matrix.php }} tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - uses: shivammathur/setup-php@v2 with: 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/wamp/composer.json b/pkg/wamp/composer.json index be0321c6f..3d260254f 100644 --- a/pkg/wamp/composer.json +++ b/pkg/wamp/composer.json @@ -6,12 +6,14 @@ "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", - "thruway/pawl-transport": "^0.5.1", + "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"