DE-175591 fix: pin rector below 2.5.9, which removed classes this package wires - #126
DE-175591 fix: pin rector below 2.5.9, which removed classes this package wires#126tomasJancar wants to merge 1 commit into
Conversation
…kage 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) <noreply@anthropic.com>
|
Superseded by #127, which fixes the cause instead of pinning the version. #127 moves the ~100 lines of path matching into our own Leaving this open for now as a fallback in case #127 needs discussion; will close it once #127 is merged. |
|
Closing in favour of #127, which keeps the rector/rector constraint at Verified on the #127 branch: fresh install resolves rector 2.5.9 and PHPStan, 80 tests, Rector dry-run and ECS are all green — also green on 2.5.8. |
Description: Pin rector/rector below 2.5.9, which removed Skipper classes this package registers as PHPStan services
Possible impact: Fixes the PHPStan and Rector CI jobs in every repository consuming this package
What broke
Rector 2.5.9 removed three classes and one method this package depends on:
Rector\Skipper\FileSystem\FnMatchPathNormalizerdefault-phpstan.neon+phpstan.neonservice listRector\Skipper\FnmatcherRector\Skipper\RealpathMatcherFileInfoMatcher::doesFileInfoMatchPatterns()DisallowConstantsInTestsRule,DisallowConstantsInTestsRectorResult — every consumer's PHPStan run dies before analysing anything:
Why it hit everyone at once
None of these repos commit a
composer.lock, so CI resolves the newest matching dependency on every run. The constraint was^2.3, so the day 2.5.9 was published, PHPStan and Rector started failing on branches that changed nothing related to either.Found it while opening an unrelated PR on platform-api-client. Confirmed it is not the PR by cloning
platform-api-clientmaster and installing fresh — identical failure, somasteris red too, and 10 repos consume this package.Bisected precisely: 2.5.8 works, 2.5.9 breaks.
Why pin rather than support 2.5.9
The two versions cannot be satisfied by one service list.
FileInfoMatchertakes those three classes as constructor dependencies in ≤2.5.8 and none in 2.5.9, and PHPStan autowires the constructor from the service list — so any single configuration is wrong for one of the versions.Supporting 2.5.9 means reworking the rule and the service list around the new API (
matchPattern()returns the matched pattern instead of abool), which is a behavioural change to a shared rule and deserves its own PR. This one just gets the builds green.Test plan
Follow-up
Two things worth separate tickets:
FileInfoMatcherAPI, then lift the pin.composer.lock(or at least pin the dev tooling) in these repos. Without one, any upstream release can turn every CI run red with no local change, which is exactly what happened here.🤖 Generated with Claude Code