Skip to content

Commit b049dd9

Browse files
authored
fix(core): fix SkipDiscovery attributes not being detected in vendor packages (#1337)
1 parent f6eabfe commit b049dd9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/core/src/Kernel/LoadDiscoveryClasses.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ private function scan(DiscoveryLocation $location, array $discoveries, string $p
158158
}
159159
} elseif (class_exists($className)) {
160160
$input = new ClassReflector($className);
161+
}
161162

163+
if ($input instanceof ClassReflector) {
164+
// Resolve `#[SkipDiscovery]` for this class
162165
$skipDiscovery = $input->getAttribute(SkipDiscovery::class);
163166

164167
if ($skipDiscovery !== null && $skipDiscovery->except === []) {
@@ -168,11 +171,11 @@ private function scan(DiscoveryLocation $location, array $discoveries, string $p
168171
$this->shouldSkipForClass[$className][$except] = true;
169172
}
170173
}
171-
}
172174

173-
// Check skipping once again, because at this point we might have converted our path to a class
174-
if ($this->shouldSkipBasedOnConfig($input)) {
175-
return;
175+
// Check skipping once again, because at this point we might have converted our path to a class
176+
if ($this->shouldSkipBasedOnConfig($input)) {
177+
return;
178+
}
176179
}
177180
}
178181

0 commit comments

Comments
 (0)