File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 2222final class LoadDiscoveryClasses
2323{
2424 private array $ appliedDiscovery = [];
25+ private array $ shouldSkipForClass = [];
2526
2627 public function __construct (
2728 private readonly Kernel $ kernel ,
@@ -228,13 +229,18 @@ private function shouldSkipBasedOnConfig(ClassReflector|string $input): bool
228229 */
229230 private function shouldSkipDiscoveryForClass (Discovery $ discovery , ClassReflector $ input ): bool
230231 {
231- $ attribute = $ input ->getAttribute (SkipDiscovery::class);
232+ if (! isset ($ this ->shouldSkipForClass [$ input ->getName ()])) {
233+ $ attribute = $ input ->getAttribute (SkipDiscovery::class);
234+
235+ if ($ attribute === null ) {
236+ return false ;
237+ }
238+
239+ $ this ->shouldSkipForClass [$ input ->getName ()] = $ attribute ->except ;
232240
233- if ($ attribute === null ) {
234- return false ;
235241 }
236242
237- return ! in_array ($ discovery ::class, $ attribute -> except , strict: true );
243+ return ! in_array ($ discovery ::class, $ this -> shouldSkipForClass [ $ input -> getName ()] , strict: true );
238244 }
239245
240246 /**
You can’t perform that action at this time.
0 commit comments