From 4fda1ed09add0840514f0842939a4573c6ab8acf Mon Sep 17 00:00:00 2001 From: tomasJancar Date: Fri, 31 Jul 2026 15:22:36 +0200 Subject: [PATCH] DE-175591 fix: pin rector below 2.5.9, which removed classes this package wires Rector 2.5.9 removed Rector\Skipper\FileSystem\FnMatchPathNormalizer, Rector\Skipper\Fnmatcher and Rector\Skipper\RealpathMatcher, and dropped FileInfoMatcher::doesFileInfoMatchPatterns() along with the three constructor dependencies. default-phpstan.neon registers those classes as services and DisallowConstantsInTestsRule / DisallowConstantsInTestsRector call the removed method, so every consumer's PHPStan run dies with: Service (Rector\Skipper\FileSystem\FnMatchPathNormalizer::__construct()): Class 'Rector\Skipper\FileSystem\FnMatchPathNormalizer' not found. None of these repositories commit a composer.lock, so CI installs the newest matching dependency and started picking 2.5.9 the moment it was released - the PHPStan and Rector jobs broke on branches that changed nothing related. Verified by cloning platform-api-client master and installing fresh: same failure. Pinning is the fix that restores the builds now. Supporting 2.5.9 needs the rule and the service list reworked around the new API (matchPattern() returning the matched pattern instead of a bool, no constructor dependencies), which is a separate change - the two versions cannot be satisfied by one service list, because PHPStan autowires the constructor. Verified with a fresh install: rector 2.5.8 resolved, PHPStan clean, 80 tests green, Rector dry-run clean. Co-Authored-By: Claude Opus 5 (1M context) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d7c5246..db6f603 100755 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpstan/phpstan-nette": "^2.0", "phpstan/phpstan-phpunit": "^2.0", "phpstan/phpstan-strict-rules": "^2.0", - "rector/rector": "^2.3", + "rector/rector": "^2.3 <2.5.9", "slevomat/coding-standard": "^8.15.0", "squizlabs/php_codesniffer": "^3.9.2", "symplify/easy-coding-standard": "^12.1.14",