fix: because the cached discoveryState does not use ->setDiscoveryState(), it is found that the discoveryState cannot be used (#120)

Co-authored-by: X2NX <x2nx@qq.com>
This commit is contained in:
OK Xaas 2025-10-27 06:25:09 +08:00 • committed by GitHub
commit 42b5261612
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,12 +38,14 @@ final class DiscoveryLoader implements LoaderInterface
public function load(ReferenceRegistryInterface $registry): void
{
// This now encapsulates the discovery process
$discoverer = new Discoverer($registry, $this->logger);
$discoverer = new Discoverer($this->logger);
$cachedDiscoverer = $this->cache
? new CachedDiscoverer($discoverer, $this->cache, $this->logger)
: $discoverer;
$cachedDiscoverer->discover($this->basePath, $this->scanDirs, $this->excludeDirs);
$discoveryState = $cachedDiscoverer->discover($this->basePath, $this->scanDirs, $this->excludeDirs);
$registry->setDiscoveryState($discoveryState);
}
}