Skip to content

Commit 78f22d0

Browse files
committed
Updated Rector to commit 47abd237bd92b3c76b129e37c0c3bc30505a8262
rectorphp/rector-src@47abd23 [dx] skipping - print full rule + path if provided (#8064)
1 parent 0094103 commit 78f22d0

2 files changed

Lines changed: 25 additions & 11 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 = 'af7a3021fcaae31ec36b96fb101f25a18a0143b9';
22+
public const PACKAGE_VERSION = '47abd237bd92b3c76b129e37c0c3bc30505a8262';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-06-20 13:34:41';
27+
public const RELEASE_DATE = '2026-06-20 13:41:44';
2828
/**
2929
* @var int
3030
*/

src/Reporting/MissConfigurationReporter.php

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,34 @@ public function reportUnusedSkips(ProcessResult $processResult): void
4848
if (!SimpleParameterProvider::provideBoolParameter(Option::REPORT_UNUSED_SKIPS, \false)) {
4949
return;
5050
}
51-
// rule-scoped path skips are trackable at runtime; skip-everywhere rule skips
52-
// (null path) are forgotten from the container at boot, so they never reach the skipper.
53-
// rule-scoped paths are intentional, so they are reported even as mask paths
54-
$skippedClassPaths = [];
55-
foreach ($this->skippedClassResolver->resolve() as $paths) {
51+
// map of trackable skip path => human-readable display; skips are tracked at runtime by
52+
// their path, but rule-scoped ones are printed as "rule => path" so the user knows exactly
53+
// what to remove. Skip-everywhere rule skips (null path) are forgotten from the container
54+
// at boot, so they never reach the skipper and cannot be tracked.
55+
$skipDisplaysByPath = [];
56+
foreach ($this->skippedClassResolver->resolve() as $rectorClass => $paths) {
5657
if ($paths === null) {
5758
continue;
5859
}
59-
$skippedClassPaths = array_merge($skippedClassPaths, $paths);
60+
// rule-scoped paths are intentional, so they are reported even as mask paths
61+
foreach ($paths as $path) {
62+
$skipDisplaysByPath[$path] = $rectorClass . ' => ' . $path;
63+
}
6064
}
6165
// global mask paths like "*/some/*" are hard to spot and report false positives, skip them
62-
$globalPaths = array_filter($this->skippedPathsResolver->resolve(), static fn(string $skip): bool => strpos($skip, '*') === \false);
63-
$configuredSkips = array_merge($skippedClassPaths, $globalPaths);
64-
$unusedSkips = array_values(array_diff($configuredSkips, $processResult->getUsedSkips()));
66+
foreach ($this->skippedPathsResolver->resolve() as $globalPath) {
67+
if (strpos($globalPath, '*') !== \false) {
68+
continue;
69+
}
70+
$skipDisplaysByPath[$globalPath] = $globalPath;
71+
}
72+
$usedSkips = $processResult->getUsedSkips();
73+
$unusedSkips = [];
74+
foreach ($skipDisplaysByPath as $path => $skipDisplay) {
75+
if (!in_array($path, $usedSkips, \true)) {
76+
$unusedSkips[] = $skipDisplay;
77+
}
78+
}
6579
if ($unusedSkips === []) {
6680
return;
6781
}

0 commit comments

Comments
 (0)