Skip to content

[skip] track used skips as class => [paths] map#8074

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-skip-11
Jun 21, 2026
Merged

[skip] track used skips as class => [paths] map#8074
TomasVotruba merged 1 commit into
mainfrom
tv-skip-11

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Tracks used skips as a class => [path, path2] map instead of flat class|path join strings, matching the shape skips are already configured with in ->withSkip().

Before

ProcessResult::getUsedSkips() returned string[] where rule-scoped skips were encoded as "class|path", forcing the resolver to rebuild that join string to test membership:

if (! in_array($rectorClass . '|' . $path, $usedSkips, true)) {

After

getUsedSkips() returns array<string, string[]> — rule class to its matched paths — so the lookup is a direct nested check:

if (! in_array($path, $usedSkips[$rectorClass] ?? [], true)) {

Changes

  • UsedSkipCollector::markUsed(string $skip, ?string $path = null) stores a nested map; provide() returns class => [paths].
  • SkipSkipper marks the matched path under its rule instead of joining with |.
  • ProcessResult constructor/addUsedSkips() validate and merge the nested shape per key.
  • ParallelFileProcessor merges worker maps nested.
  • Global path-only skips stay tracked by their own key (empty path set); resolver uses array_key_exists.

Tests updated accordingly. composer complete-check green.

@TomasVotruba TomasVotruba merged commit 2328ea6 into main Jun 21, 2026
67 checks passed
@TomasVotruba TomasVotruba deleted the tv-skip-11 branch June 21, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant