You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Removing a skip after a --clear-cache run does not invalidate the cache #9970
--clear-cache also deletes the configuration snapshot that ChangedFilesDetector::setFirstResolvedConfigFileInfo() has just stored. The snapshot is saved while the container is created (RectorContainerFactory), and FilesFinder::findFilesInPaths() then calls ChangedFilesDetector::clear(), which empties the whole cache. The run then caches every file as unchanged, but no snapshot is left. On the next run invalidateCacheIfConfigurationChanged() finds no previous snapshot, treats it as the first run, and keeps those entries. A rule that was skipped or not registered before that run therefore never reaches the cached files.
vendor/bin/rector process --dry-run --clear-cache reports no change, as expected.
Remove the ->withSkip(...) call.
vendor/bin/rector process --dry-run still reports no change.
Without --clear-cache in step 1, step 3 reports the change. With --clear-cache in step 3, it reports it too.
Expected Behaviour
Step 3 reports src/Foo.php (RemoveUnusedVariableAssignRector), as it does when step 1 runs without --clear-cache.
A possible fix: store the snapshot again after clear() in FilesFinder::findFilesInPaths(), or let ChangedFilesDetector::clear() keep the configuration snapshot it stored for this run.
Activity
samsonasik commentedon Nov 15, 2026
I created PR:
for it.