Skip to content

Commit

Permalink
final touch: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 23, 2024
1 parent d5c49d2 commit 13eb4ed
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function provide(): SourceLocator

$aggregateSourceLocator = $this->aggregateSourceLocator = new AggregateSourceLocator($sourceLocators);

$this->collectClasses($sourceLocators, $isPHPUnitRun);
$this->collectClasses($aggregateSourceLocator, $sourceLocators, $isPHPUnitRun);

return $aggregateSourceLocator;
}
Expand All @@ -113,7 +113,7 @@ public function reset(): void
/**
* @param OptimizedSingleFileSourceLocator[]|NewOptimizedDirectorySourceLocator[] $sourceLocators
*/
private function collectClasses(array $sourceLocators, bool $isPHPUnitRun): void
private function collectClasses(AggregateSourceLocator $aggregateSourceLocator, array $sourceLocators, bool $isPHPUnitRun): void
{
if ($sourceLocators === []) {
return;
Expand All @@ -129,9 +129,7 @@ private function collectClasses(array $sourceLocators, bool $isPHPUnitRun): void
return;
}

// use AggregateSourceLocator from property fetch, otherwise, it will cause infinite loop
// checked at https://github.com/samsonasik/ci4-album/pull/16
$reflector = new DefaultReflector($this->aggregateSourceLocator);
$reflector = new DefaultReflector($aggregateSourceLocator);

foreach ($sourceLocators as $sourceLocator) {
// trigger collect "classes" on get class on locate identifier
Expand Down

0 comments on commit 13eb4ed

Please sign in to comment.