From 0dee2909ac1966bab7b05420126fda2788767662 Mon Sep 17 00:00:00 2001 From: Xavier Marchegay Date: Tue, 9 Dec 2025 13:05:11 +0100 Subject: [PATCH 1/4] Implements #22 * Bump PHP to 8.2+ and enable support for Symfony 6.4, 7.4, and 8.0 in composer.json. * Add PHP 8.5 support in GitHub workflows and Docker configuration. * Update PHPUnit dependencies * Migrate from PHPDoc annotations to PHPUnit attributes in test classes. * Update .github/workflows/test.yml and .github/workflows/quality.yml to use actions/checkout@v6. * Adjust Rector configuration for PHP 8.5 compatibility. * Update Dockerfile to reflect changes in PHP version and simplifications. * Update CHANGELOG.md --- .docker/php/Dockerfile | 5 ++--- .github/workflows/quality.yml | 12 +++++----- .github/workflows/test.yml | 41 ++++++++++++++++++++++++----------- .php-cs-fixer.dist.php | 1 - CHANGELOG.md | 9 ++++++++ composer.json | 14 ++++++++---- phpunit.xml.dist | 21 +++++++----------- rector.php | 6 ++--- 8 files changed, 66 insertions(+), 43 deletions(-) diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 33dd796..82be215 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.4-fpm-alpine +FROM php:8.5-fpm-alpine ARG UID ARG GID @@ -13,8 +13,7 @@ RUN apk update && apk add \ bash \ icu-dev \ && docker-php-ext-configure intl \ - && docker-php-ext-install intl opcache \ - && docker-php-ext-enable opcache + && docker-php-ext-install intl RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime \ && sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Paris/" $PHP_INI_DIR/php.ini diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index a07ce8b..f4e4f5b 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 - name: Install Composer dependencies (locked) @@ -32,11 +32,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 - name: Install Composer dependencies (locked) @@ -49,11 +49,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' coverage: none tools: composer:v2 - name: Install Composer dependencies (locked) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e07db0..27a5a54 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,16 +23,12 @@ jobs: - '8.2' - '8.3' - '8.4' + - '8.5' dependencies: [highest] allowed-to-fail: [false] symfony-require: [''] variant: [normal] include: - - php-version: '8.1' - dependencies: highest - allowed-to-fail: false - symfony-require: 6.4.* - variant: symfony/symfony:"6.4.*" - php-version: '8.2' dependencies: highest allowed-to-fail: false @@ -41,8 +37,8 @@ jobs: - php-version: '8.2' dependencies: highest allowed-to-fail: false - symfony-require: 7.3.* - variant: symfony/symfony:"7.3.*" + symfony-require: 7.4.* + variant: symfony/symfony:"7.4.*" - php-version: '8.3' dependencies: highest allowed-to-fail: false @@ -51,8 +47,8 @@ jobs: - php-version: '8.3' dependencies: highest allowed-to-fail: false - symfony-require: 7.3.* - variant: symfony/symfony:"7.3.*" + symfony-require: 7.4.* + variant: symfony/symfony:"7.4.*" - php-version: '8.4' dependencies: highest allowed-to-fail: false @@ -61,12 +57,31 @@ jobs: - php-version: '8.4' dependencies: highest allowed-to-fail: false - symfony-require: 7.3.* - variant: symfony/symfony:"7.3.*" - + symfony-require: 7.4.* + variant: symfony/symfony:"7.4.*" + - php-version: '8.4' + dependencies: highest + allowed-to-fail: false + symfony-require: 8.* + variant: symfony/symfony:"8.*" + - php-version: '8.5' + dependencies: highest + allowed-to-fail: false + symfony-require: 6.4.* + variant: symfony/symfony:"6.4.*" + - php-version: '8.5' + dependencies: highest + allowed-to-fail: false + symfony-require: 7.4.* + variant: symfony/symfony:"7.4.*" + - php-version: '8.5' + dependencies: highest + allowed-to-fail: false + symfony-require: 8.* + variant: symfony/symfony:"8.*" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions uses: shivammathur/setup-php@v2 with: diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 7e90154..22372f9 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -24,7 +24,6 @@ return (new PhpCsFixer\Config()) ->setRules([ - '@PHP71Migration' => true, '@PHP82Migration' => true, '@PHPUnit75Migration:risky' => true, '@Symfony' => true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 3abf7c1..a43828d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +v3.0 +------ + +### Changes +* [#22](https://github.com/cleverage/rest-process-bundle/issues/22) Add support for PHP 8.5 and Symfony 8.* Update phpunit/phpunit to version >10.0 Bump version to cleverage/process-bundle ^5.0 + +### BC breaks +* [#22](https://github.com/cleverage/rest-process-bundle/issues/22) Remove support for PHP 8.1 and Symfony 7.3 + v2.3 ------ diff --git a/composer.json b/composer.json index 4c76571..05b8273 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,12 @@ "email": "mveyrenc@clever-age.com", "homepage": "https://github.com/mveyrenc", "role": "Developer" + }, + { + "name": "Xavier Marchegay", + "email": "xmarchegay@clever-age.com", + "homepage": "https://github.com/xmarchegay", + "role": "Lead Developer" } ], "autoload": { @@ -43,16 +49,16 @@ } }, "require": { - "php": ">=8.1", - "cleverage/process-bundle": "^4.0", - "symfony/http-client": "^6.4|^7.3" + "php": ">=8.2", + "cleverage/process-bundle": "^5.0", + "symfony/http-client": "^6.4|^7.4|^8" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", "phpstan/extension-installer": "*", "phpstan/phpstan": "*", "phpstan/phpstan-symfony": "*", - "phpunit/phpunit": "<10.0", + "phpunit/phpunit": "*", "rector/rector": "*", "roave/security-advisories": "dev-latest", "symfony/test-pack": "^1.1" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 766495c..c3e7947 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,27 +1,22 @@ + failOnWarning="true"> tests - - + src - - + + \ No newline at end of file diff --git a/rector.php b/rector.php index b19c112..cf96a04 100644 --- a/rector.php +++ b/rector.php @@ -8,17 +8,17 @@ use Rector\ValueObject\PhpVersion; return RectorConfig::configure() - ->withPhpVersion(PhpVersion::PHP_84) + ->withPhpVersion(PhpVersion::PHP_85) ->withPaths([ __DIR__.'/src', __DIR__.'/tests', ]) - ->withPhpSets(php81: true) + ->withPhpSets(php82: true) // here we can define, what prepared sets of rules will be applied ->withPreparedSets(deadCode: true, codeQuality: true, symfonyCodeQuality: true) ->withAttributesSets(symfony: true) ->withSets([ - LevelSetList::UP_TO_PHP_81, + LevelSetList::UP_TO_PHP_82, SymfonySetList::SYMFONY_64, SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, From ebefcf0e189c3e314d1c0f01777723c466f304b5 Mon Sep 17 00:00:00 2001 From: Xavier Marchegay Date: Tue, 9 Dec 2025 13:40:59 +0100 Subject: [PATCH 2/4] #22 - Update PHP CS Fixer rules for PHP 8.2 and PHPUnit 7.5 compatibility --- .php-cs-fixer.dist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 22372f9..4317057 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -24,8 +24,8 @@ return (new PhpCsFixer\Config()) ->setRules([ - '@PHP82Migration' => true, - '@PHPUnit75Migration:risky' => true, + '@PHP8x2Migration' => true, + '@PHPUnit7x5Migration:risky' => true, '@Symfony' => true, '@Symfony:risky' => true, 'protected_to_private' => false, From 2c235f6bb33b7d9e639985a9b72579a0a0eac61d Mon Sep 17 00:00:00 2001 From: Xavier Marchegay Date: Tue, 9 Dec 2025 14:00:28 +0100 Subject: [PATCH 3/4] #22 - Fix composer.json syntax to use `||` for symfony/http-client version constraints --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 05b8273..f060e7b 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "require": { "php": ">=8.2", "cleverage/process-bundle": "^5.0", - "symfony/http-client": "^6.4|^7.4|^8" + "symfony/http-client": "^6.4 || ^7.4 || ^8" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", From 587d91d8ae542f26b735c6fd569c83ced50112fd Mon Sep 17 00:00:00 2001 From: xmarchegay Date: Tue, 9 Dec 2025 18:17:11 +0100 Subject: [PATCH 4/4] #22 - Add PHPUnit 10.0 set to Rector configuration --- rector.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rector.php b/rector.php index cf96a04..aa1b078 100644 --- a/rector.php +++ b/rector.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Rector\Config\RectorConfig; +use Rector\PHPUnit\Set\PHPUnitSetList; use Rector\Set\ValueObject\LevelSetList; use Rector\Symfony\Set\SymfonySetList; use Rector\ValueObject\PhpVersion; @@ -19,6 +20,7 @@ ->withAttributesSets(symfony: true) ->withSets([ LevelSetList::UP_TO_PHP_82, + PHPUnitSetList::PHPUNIT_100, SymfonySetList::SYMFONY_64, SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,