From 31098f51c9f9b6566d866f623f1adc18df28cf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 29 Jul 2025 07:25:42 +0200 Subject: [PATCH 1/6] Allow PHP 8.5 as max version --- conf/parametersSchema.neon | 6 +++--- e2e/composer-min-open-end-version/test.php | 4 ++-- e2e/composer-min-version/test.php | 4 ++-- e2e/composer-no-versions/test.php | 2 +- src/Php/PhpVersionFactory.php | 2 +- tests/PHPStan/Analyser/ScopePhpVersionTest.php | 4 ++-- tests/PHPStan/Analyser/nsrt/predefined-constants.php | 2 +- tests/PHPStan/Php/PhpVersionFactoryTest.php | 10 ++++++++-- 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/conf/parametersSchema.neon b/conf/parametersSchema.neon index 3f60d6383d..76d8e86b40 100644 --- a/conf/parametersSchema.neon +++ b/conf/parametersSchema.neon @@ -87,10 +87,10 @@ parametersSchema: buffer: int() ]) phpVersion: schema(anyOf( - schema(int(), min(70100), max(80499)), + schema(int(), min(70100), max(80599)), structure([ - min: schema(int(), min(70100), max(80499)), - max: schema(int(), min(70100), max(80499)) + min: schema(int(), min(70100), max(80599)), + max: schema(int(), min(70100), max(80599)) ]) ), nullable()) polluteScopeWithLoopInitialAssignments: bool() diff --git a/e2e/composer-min-open-end-version/test.php b/e2e/composer-min-open-end-version/test.php index d4d06a34eb..9ed998185b 100644 --- a/e2e/composer-min-open-end-version/test.php +++ b/e2e/composer-min-open-end-version/test.php @@ -1,6 +1,6 @@ ', PHP_VERSION_ID); +\PHPStan\Testing\assertType('int<80100, 80599>', PHP_VERSION_ID); \PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); -\PHPStan\Testing\assertType('int<1, 4>', PHP_MINOR_VERSION); +\PHPStan\Testing\assertType('int<1, 5>', PHP_MINOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); diff --git a/e2e/composer-min-version/test.php b/e2e/composer-min-version/test.php index d4d06a34eb..9ed998185b 100644 --- a/e2e/composer-min-version/test.php +++ b/e2e/composer-min-version/test.php @@ -1,6 +1,6 @@ ', PHP_VERSION_ID); +\PHPStan\Testing\assertType('int<80100, 80599>', PHP_VERSION_ID); \PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION); -\PHPStan\Testing\assertType('int<1, 4>', PHP_MINOR_VERSION); +\PHPStan\Testing\assertType('int<1, 5>', PHP_MINOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); diff --git a/e2e/composer-no-versions/test.php b/e2e/composer-no-versions/test.php index 28c8a3183b..3cae7a0628 100644 --- a/e2e/composer-no-versions/test.php +++ b/e2e/composer-no-versions/test.php @@ -1,6 +1,6 @@ ', PHP_VERSION_ID); +\PHPStan\Testing\assertType('int<50207, 80599>', PHP_VERSION_ID); \PHPStan\Testing\assertType('int<5, 8>', PHP_MAJOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_MINOR_VERSION); \PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION); diff --git a/src/Php/PhpVersionFactory.php b/src/Php/PhpVersionFactory.php index eb71104673..73f510e0dc 100644 --- a/src/Php/PhpVersionFactory.php +++ b/src/Php/PhpVersionFactory.php @@ -13,7 +13,7 @@ final class PhpVersionFactory { public const MIN_PHP_VERSION = 70100; - public const MAX_PHP_VERSION = 80499; + public const MAX_PHP_VERSION = 80599; public const MAX_PHP5_VERSION = 50699; public const MAX_PHP7_VERSION = 70499; diff --git a/tests/PHPStan/Analyser/ScopePhpVersionTest.php b/tests/PHPStan/Analyser/ScopePhpVersionTest.php index 395cc0891b..193a55c53c 100644 --- a/tests/PHPStan/Analyser/ScopePhpVersionTest.php +++ b/tests/PHPStan/Analyser/ScopePhpVersionTest.php @@ -15,11 +15,11 @@ public static function dataTestPhpVersion(): array { return [ [ - 'int<80000, 80499>', + 'int<80000, 80599>', __DIR__ . '/data/scope-constants-global.php', ], [ - 'int<80000, 80499>', + 'int<80000, 80599>', __DIR__ . '/data/scope-constants-namespace.php', ], ]; diff --git a/tests/PHPStan/Analyser/nsrt/predefined-constants.php b/tests/PHPStan/Analyser/nsrt/predefined-constants.php index 9d9d1b1fc5..7c38d3833b 100644 --- a/tests/PHPStan/Analyser/nsrt/predefined-constants.php +++ b/tests/PHPStan/Analyser/nsrt/predefined-constants.php @@ -7,7 +7,7 @@ assertType('int<5, 8>', PHP_MAJOR_VERSION); assertType('int<0, max>', PHP_MINOR_VERSION); assertType('int<0, max>', PHP_RELEASE_VERSION); -assertType('int<50207, 80499>', PHP_VERSION_ID); +assertType('int<50207, 80599>', PHP_VERSION_ID); assertType('string', PHP_EXTRA_VERSION); assertType('0|1', PHP_ZTS); assertType('0|1', PHP_DEBUG); diff --git a/tests/PHPStan/Php/PhpVersionFactoryTest.php b/tests/PHPStan/Php/PhpVersionFactoryTest.php index adc5564253..3687e60e07 100644 --- a/tests/PHPStan/Php/PhpVersionFactoryTest.php +++ b/tests/PHPStan/Php/PhpVersionFactoryTest.php @@ -81,8 +81,8 @@ public static function dataCreate(): array [ null, '8.5', - 80499, - '8.4.99', + 80500, + '8.5', ], [ null, @@ -90,6 +90,12 @@ public static function dataCreate(): array 80095, '8.0.95', ], + [ + null, + '8.6', + 80599, + '8.5.99', + ], ]; } From bb8b5504604cf8ca9dedc09db05ae00bb8debbb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 29 Jul 2025 07:53:36 +0200 Subject: [PATCH 2/6] Update workflows --- .github/workflows/lint.yml | 1 + .github/workflows/reflection-golden-test.yml | 1 + .github/workflows/static-analysis.yml | 3 ++- .github/workflows/tests.yml | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 16ed00181a..e42c6f23cf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,6 +28,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" steps: - name: "Checkout" diff --git a/.github/workflows/reflection-golden-test.yml b/.github/workflows/reflection-golden-test.yml index 91b38f9e13..44cceae778 100644 --- a/.github/workflows/reflection-golden-test.yml +++ b/.github/workflows/reflection-golden-test.yml @@ -67,6 +67,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" steps: - uses: Wandalen/wretry.action@v3.8.0 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index af50f11f51..bebb3f7483 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -34,6 +34,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" operating-system: [ubuntu-latest, windows-latest] steps: @@ -79,7 +80,7 @@ jobs: php-version: - "8.2" - "8.3" - - "8.4" + - "8.5" steps: - name: "Checkout" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 328020a361..c431ecee52 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" operating-system: [ ubuntu-latest, windows-latest ] steps: From 067bb06a12087b6eb63d394a7dd575507c13df5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 29 Jul 2025 08:11:32 +0200 Subject: [PATCH 3/6] Do not remove 8.4 --- .github/workflows/static-analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index bebb3f7483..a49e5e7623 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -80,6 +80,7 @@ jobs: php-version: - "8.2" - "8.3" + - "8.4" - "8.5" steps: From c253a39a56315805a47f452feef2ff8b9a714342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 29 Jul 2025 09:59:20 +0200 Subject: [PATCH 4/6] Update `Makefile` --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index da87ae01aa..f87b1781dc 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ build: cs tests phpstan tests: install-paratest + rm vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php XDEBUG_MODE=off php tests/vendor/bin/paratest --runner WrapperRunner --no-coverage tests-integration: install-paratest From 91dece24fbd0e68eedd653fd738aa32368ad9309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 29 Jul 2025 10:15:19 +0200 Subject: [PATCH 5/6] Remove `vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php` in post install script --- Makefile | 1 - composer.json | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f87b1781dc..da87ae01aa 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ build: cs tests phpstan tests: install-paratest - rm vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php XDEBUG_MODE=off php tests/vendor/bin/paratest --runner WrapperRunner --no-coverage tests-integration: install-paratest diff --git a/composer.json b/composer.json index 1c0c469983..deea256c91 100644 --- a/composer.json +++ b/composer.json @@ -233,6 +233,11 @@ ], "minimum-stability": "dev", "prefer-stable": true, + "scripts": { + "post-install-cmd": [ + "rm vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php" + ] + }, "bin": [ "bin/phpstan" ] From 445b9d2b0ef1572e2f3ea4890caecac5df0d91a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Tue, 29 Jul 2025 11:09:05 +0200 Subject: [PATCH 6/6] Update `composer.json` --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index deea256c91..5f294a4c5e 100644 --- a/composer.json +++ b/composer.json @@ -235,7 +235,7 @@ "prefer-stable": true, "scripts": { "post-install-cmd": [ - "rm vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php" + "rm -f vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php" ] }, "bin": [