Skip to content

Drop the cacheClass() call Rector 2.8 removed - #98

Merged
loevgaard merged 1 commit into
2.2.xfrom
fix-rector-cache-class-2.2.x
Nov 2, 2026
Merged

loevgaard merged 1 commit into
2.2.xfrom
fix-rector-cache-class-2.2.x

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Summary

Rector 2.8 removed RectorConfig::cacheClass(), so vendor/bin/rector process --dry-run errors on highest deps, in the skeleton and in every plugin generated from it (seen on Setono/SyliusQuickpayPlugin#143, fixed there in Setono/SyliusQuickpayPlugin#144).

-use Rector\Caching\ValueObject\Storage\FileCacheStorage;
 ...
-    $rectorConfig->cacheClass(FileCacheStorage::class);
     $rectorConfig->cacheDirectory('./.build/rector');

FileCacheStorage is Rector's default cache storage, and the only one left in 2.8, so the cache behaviour is unchanged.

Evidence

rector process --dry-run with Rector 2.8.3, run on SyliusQuickpayPlugin's identical config:

  • Before: [ERROR] Call to undefined method Rector\Config\RectorConfig::cacheClass()
    After: [OK] Rector is done!

Still [OK] on Rector 2.6.1. This PR's own coding-standards job runs it on the skeleton.

Merge Danger

Door: two-way

Blast Radius: none

Dev tooling config only; plugins already generated from the skeleton need the same two-line change.

Rector 2.8 removed RectorConfig::cacheClass(), so 'vendor/bin/rector process' fails with 'Call to undefined method' on highest deps. FileCacheStorage is Rector's default cache storage (and the only one left in 2.8), so dropping the call keeps the behaviour.
@loevgaard
loevgaard merged commit ecdeaf2 into 2.2.x Nov 2, 2026
92 checks passed
@loevgaard
loevgaard deleted the fix-rector-cache-class-2.2.x branch November 2, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant