Skip to content

Commit 7cc4782

Browse files
committed
Merge branch 2.1.x into 2.2.x
2 parents e94f9bd + d32604d commit 7cc4782

2 files changed

Lines changed: 4 additions & 56 deletions

File tree

src/PhpDoc/StubSourceLocatorFactory.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PHPStan\BetterReflection\SourceLocator\Type\MemoizingSourceLocator;
1111
use PHPStan\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator;
1212
use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator;
13-
use PHPStan\Reflection\BetterReflection\SourceLocator\LazySourceLocator;
1413
use PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedPsrAutoloaderLocatorFactory;
1514
use PHPStan\Reflection\BetterReflection\SourceLocator\OptimizedSingleFileSourceLocatorRepository;
1615
use function dirname;
@@ -31,14 +30,10 @@ public function __construct(
3130
public function create(): SourceLocator
3231
{
3332
$locators = [];
34-
$locators[] = new LazySourceLocator(function () {
35-
$locators = [];
36-
foreach ($this->stubFilesProvider->getStubFiles() as $stubFile) {
37-
$locators[] = $this->optimizedSingleFileSourceLocatorRepository->getOrCreate($stubFile);
38-
}
39-
40-
return new AggregateSourceLocator($locators);
41-
});
33+
$astPhp8Locator = new Locator($this->php8Parser);
34+
foreach ($this->stubFilesProvider->getStubFiles() as $stubFile) {
35+
$locators[] = $this->optimizedSingleFileSourceLocatorRepository->getOrCreate($stubFile);
36+
}
4237

4338
$locators[] = $this->optimizedPsrAutoloaderLocatorFactory->create(
4439
Psr4Mapping::fromArrayMappings([
@@ -51,7 +46,6 @@ public function create(): SourceLocator
5146
]),
5247
);
5348

54-
$astPhp8Locator = new Locator($this->php8Parser);
5549
$locators[] = new PhpInternalSourceLocator($astPhp8Locator, $this->phpStormStubsSourceStubber);
5650

5751
return new MemoizingSourceLocator(new AggregateSourceLocator($locators));

src/Reflection/BetterReflection/SourceLocator/LazySourceLocator.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)