From 636d566778f596551e577b54c102fc563cf0c0f7 Mon Sep 17 00:00:00 2001 From: Nicolas Joubert Date: Thu, 24 Sep 2026 13:42:19 +0200 Subject: [PATCH] #28 - Update quality stack - rector.php: replace removed SymfonySetList::SYMFONY_64 / PHPUnitSetList::PHPUNIT_100 sets by withComposerBased() - composer.json: declare used Symfony packages and set a PHPUnit range, so Rector targets the lowest supported versions - Apply rector / php-cs-fixer / phpstan run Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 6 ++++++ composer.json | 10 ++++++++-- rector.php | 5 +---- src/Task/RequestTask.php | 4 ++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a43828d..367e9ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Latest +------ + +### Changes +* [#28](https://github.com/cleverage/rest-process-bundle/issues/28) Update quality stack: use Rector `withComposerBased()` sets (removed `SYMFONY_64` / `PHPUNIT_100` sets), declare used Symfony packages and PHPUnit range in composer.json, apply quality tools fixes + v3.0 ------ diff --git a/composer.json b/composer.json index f060e7b..6111d31 100644 --- a/composer.json +++ b/composer.json @@ -51,14 +51,20 @@ "require": { "php": ">=8.2", "cleverage/process-bundle": "^5.0", - "symfony/http-client": "^6.4 || ^7.4 || ^8" + "symfony/config": "^6.4 || ^7.4 || ^8", + "symfony/dependency-injection": "^6.4 || ^7.4 || ^8", + "symfony/finder": "^6.4 || ^7.4 || ^8", + "symfony/http-client": "^6.4 || ^7.4 || ^8", + "symfony/http-client-contracts": "^3", + "symfony/http-kernel": "^6.4 || ^7.4 || ^8", + "symfony/options-resolver": "^6.4 || ^7.4 || ^8" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", "phpstan/extension-installer": "*", "phpstan/phpstan": "*", "phpstan/phpstan-symfony": "*", - "phpunit/phpunit": "*", + "phpunit/phpunit": "^10.5 || ^11 || ^12 || ^13", "rector/rector": "*", "roave/security-advisories": "dev-latest", "symfony/test-pack": "^1.1" diff --git a/rector.php b/rector.php index aa1b078..7628528 100644 --- a/rector.php +++ b/rector.php @@ -3,7 +3,6 @@ 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; @@ -16,13 +15,11 @@ ]) ->withPhpSets(php82: true) // here we can define, what prepared sets of rules will be applied + ->withComposerBased(phpunit: true, symfony: true) ->withPreparedSets(deadCode: true, codeQuality: true, symfonyCodeQuality: true) ->withAttributesSets(symfony: true) ->withSets([ LevelSetList::UP_TO_PHP_82, - PHPUnitSetList::PHPUNIT_100, - SymfonySetList::SYMFONY_64, - SymfonySetList::SYMFONY_CODE_QUALITY, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, ]) ; diff --git a/src/Task/RequestTask.php b/src/Task/RequestTask.php index 16997e5..bf41dcf 100644 --- a/src/Task/RequestTask.php +++ b/src/Task/RequestTask.php @@ -112,8 +112,8 @@ public function execute(ProcessState $state): void $allowClientException = true; } } - if (!($allowRedirectionException && $e instanceof RedirectionExceptionInterface) - && !($allowClientException && $e instanceof ClientExceptionInterface) + if ((!$allowRedirectionException || !$e instanceof RedirectionExceptionInterface) + && (!$allowClientException || !$e instanceof ClientExceptionInterface) ) { $this->logger->error( 'REST request failed',