From 9f7ebd174f4ef78a7cdfcb8d15072cd544052626 Mon Sep 17 00:00:00 2001 From: osteel Date: Thu, 6 Nov 2025 16:06:03 +0000 Subject: [PATCH 1/4] PHPUnit 10 --- composer.json | 1 - rector.php | 3 ++- tests/ValidatorBuilderTest.php | 2 +- tests/ValidatorTest.php | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 4db50c3..892d2d4 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,6 @@ ], "require": { "php": "^8.0", - "ext-json": "*", "league/openapi-psr7-validator": "^0.22", "nyholm/psr7": "^1.3.1", "psr/cache": "^1.0 || ^2.0 || ^3.0", diff --git a/rector.php b/rector.php index 52a4828..14ff33e 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; return static function (RectorConfig $rectorConfig): void { @@ -11,5 +12,5 @@ __DIR__ . '/tests', ]); - $rectorConfig->sets([LevelSetList::UP_TO_PHP_80]); + $rectorConfig->sets([LevelSetList::UP_TO_PHP_80, PHPUnitSetList::PHPUNIT_100]); }; diff --git a/tests/ValidatorBuilderTest.php b/tests/ValidatorBuilderTest.php index f10f023..b1e3b2a 100644 --- a/tests/ValidatorBuilderTest.php +++ b/tests/ValidatorBuilderTest.php @@ -13,7 +13,7 @@ class ValidatorBuilderTest extends TestCase { - public function definitionProvider(): array + public static function definitionProvider(): array { return [ ['fromYaml', self::$yamlDefinition], diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index 6b8c164..9586982 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -25,7 +25,7 @@ protected function setUp(): void |-------------------------------------------------------------------------- */ - public function requestTypeProvider(): array + public static function requestTypeProvider(): array { return [ ['httpFoundationRequest'], @@ -73,7 +73,7 @@ public function test_it_validates_the_request_with_payload(string $method) $this->assertTrue($result); } - public function bodylessRequestMethodProvider(): array + public static function bodylessRequestMethodProvider(): array { return [ ['delete'], @@ -93,7 +93,7 @@ public function test_it_validates_the_request_without_payload_using_method_short $this->assertTrue($result); } - public function requestMethodProvider(): array + public static function requestMethodProvider(): array { return [ ['patch'], @@ -117,7 +117,7 @@ public function test_it_validates_the_request_with_paylod_using_shortcuts(string |-------------------------------------------------------------------------- */ - public function responseTypeProvider(): array + public static function responseTypeProvider(): array { return [ ['httpFoundationResponse'], @@ -145,7 +145,7 @@ public function test_it_validates_the_response(string $method) $this->assertTrue($result); } - public function responseMethodProvider(): array + public static function responseMethodProvider(): array { return [ ['delete'], @@ -172,7 +172,7 @@ public function test_it_validates_the_response_using_method_shortcuts(string $me |-------------------------------------------------------------------------- */ - public function pathProvider(): array + public static function pathProvider(): array { return [ ['/test'], From 5f8af0d267df803253d1c1d34a01c9b4adda12c3 Mon Sep 17 00:00:00 2001 From: osteel Date: Thu, 6 Nov 2025 16:11:28 +0000 Subject: [PATCH 2/4] PHP CS Fixer 3.80 (PHP 8.4 support) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 892d2d4..0590532 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "symfony/psr-http-message-bridge": "^2.0 || ^6.0 || ^7.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.17", + "friendsofphp/php-cs-fixer": "^3.80", "phpstan/phpstan": "^2.1.0", "phpunit/phpunit": "^9.6", "rector/rector": "^2.1.0" From f174b7a405aef7d918f2c1ca5950820793bc3b90 Mon Sep 17 00:00:00 2001 From: osteel Date: Thu, 6 Nov 2025 16:16:35 +0000 Subject: [PATCH 3/4] PHPUnit 11 --- composer.json | 2 +- rector.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0590532..e95102d 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.80", "phpstan/phpstan": "^2.1.0", - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^11.0", "rector/rector": "^2.1.0" }, "autoload": { diff --git a/rector.php b/rector.php index 14ff33e..2acfd03 100644 --- a/rector.php +++ b/rector.php @@ -12,5 +12,5 @@ __DIR__ . '/tests', ]); - $rectorConfig->sets([LevelSetList::UP_TO_PHP_80, PHPUnitSetList::PHPUNIT_100]); + $rectorConfig->sets([LevelSetList::UP_TO_PHP_80, PHPUnitSetList::PHPUNIT_110]); }; From e14feabce150b94110551e8b7cb2da0fa293f360 Mon Sep 17 00:00:00 2001 From: osteel Date: Thu, 6 Nov 2025 16:22:18 +0000 Subject: [PATCH 4/4] reverse PHPUnit upgrade to maintain support for PHP 8.0 --- composer.json | 2 +- rector.php | 3 +-- tests/ValidatorBuilderTest.php | 2 +- tests/ValidatorTest.php | 12 ++++++------ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index e95102d..0590532 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.80", "phpstan/phpstan": "^2.1.0", - "phpunit/phpunit": "^11.0", + "phpunit/phpunit": "^9.6", "rector/rector": "^2.1.0" }, "autoload": { diff --git a/rector.php b/rector.php index 2acfd03..52a4828 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; return static function (RectorConfig $rectorConfig): void { @@ -12,5 +11,5 @@ __DIR__ . '/tests', ]); - $rectorConfig->sets([LevelSetList::UP_TO_PHP_80, PHPUnitSetList::PHPUNIT_110]); + $rectorConfig->sets([LevelSetList::UP_TO_PHP_80]); }; diff --git a/tests/ValidatorBuilderTest.php b/tests/ValidatorBuilderTest.php index b1e3b2a..f10f023 100644 --- a/tests/ValidatorBuilderTest.php +++ b/tests/ValidatorBuilderTest.php @@ -13,7 +13,7 @@ class ValidatorBuilderTest extends TestCase { - public static function definitionProvider(): array + public function definitionProvider(): array { return [ ['fromYaml', self::$yamlDefinition], diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index 9586982..6b8c164 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -25,7 +25,7 @@ protected function setUp(): void |-------------------------------------------------------------------------- */ - public static function requestTypeProvider(): array + public function requestTypeProvider(): array { return [ ['httpFoundationRequest'], @@ -73,7 +73,7 @@ public function test_it_validates_the_request_with_payload(string $method) $this->assertTrue($result); } - public static function bodylessRequestMethodProvider(): array + public function bodylessRequestMethodProvider(): array { return [ ['delete'], @@ -93,7 +93,7 @@ public function test_it_validates_the_request_without_payload_using_method_short $this->assertTrue($result); } - public static function requestMethodProvider(): array + public function requestMethodProvider(): array { return [ ['patch'], @@ -117,7 +117,7 @@ public function test_it_validates_the_request_with_paylod_using_shortcuts(string |-------------------------------------------------------------------------- */ - public static function responseTypeProvider(): array + public function responseTypeProvider(): array { return [ ['httpFoundationResponse'], @@ -145,7 +145,7 @@ public function test_it_validates_the_response(string $method) $this->assertTrue($result); } - public static function responseMethodProvider(): array + public function responseMethodProvider(): array { return [ ['delete'], @@ -172,7 +172,7 @@ public function test_it_validates_the_response_using_method_shortcuts(string $me |-------------------------------------------------------------------------- */ - public static function pathProvider(): array + public function pathProvider(): array { return [ ['/test'],