Skip to content

Commit d7cb788

Browse files
committed
Updated Rector to commit 19dcdb7816f10cb502a1b2ef5a6628185f74e49d
rectorphp/rector-src@19dcdb7 [skip] fix match class + path matching in reporting of unused skips (#8073)
1 parent 76d81c5 commit d7cb788

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'aea1570424613c9a0acbf80c3abeb41d7dd33dbe';
22+
public const PACKAGE_VERSION = '19dcdb7816f10cb502a1b2ef5a6628185f74e49d';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-06-21 12:54:50';
27+
public const RELEASE_DATE = '2026-06-21 13:42:16';
2828
/**
2929
* @var int
3030
*/

src/Reporting/UnusedSkipResolver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ private function resolveUnusedRuleScopedSkips(array $usedSkips): array
110110
foreach ($this->resolveRelativePathsByClass() as $rectorClass => $relativePaths) {
111111
$unusedRelativePaths = [];
112112
foreach ($relativePaths as $path => $relativePath) {
113-
if (!in_array($path, $usedSkips, \true)) {
113+
// used skips are tracked scoped to their rule as "class|path", so the same path
114+
// skipped under another rule does not mark this one used (see SkipSkipper)
115+
if (!in_array($rectorClass . '|' . $path, $usedSkips, \true)) {
114116
$unusedRelativePaths[] = $relativePath;
115117
}
116118
}

src/Skipper/Skipper/SkipSkipper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ public function doesMatchSkip($checker, string $filePath, array $skippedClasses)
3434
$this->usedSkipCollector->markUsed($skippedClass);
3535
return \true;
3636
}
37-
// mark the specific matched path used, so unused paths under the same rule are reported
37+
// mark the specific matched path used, scoped to its rule via "class|path" - the same
38+
// path can be skipped under multiple rules, so a path-only key would mark them all used
3839
$matchedPath = $this->fileInfoMatcher->matchPattern($filePath, $skippedFiles);
3940
if ($matchedPath !== null) {
40-
$this->usedSkipCollector->markUsed($matchedPath);
41+
$this->usedSkipCollector->markUsed($skippedClass . '|' . $matchedPath);
4142
return \true;
4243
}
4344
}

0 commit comments

Comments
 (0)