Skip to content

Commit

Permalink
No need for AutoloadSourceLocator in createPhpStormStubsReflectionPro…
Browse files Browse the repository at this point in the history
…vider
  • Loading branch information
ondrejmirtes committed May 17, 2020
1 parent 32913ed commit cf78035
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Reflection/ReflectionProvider/ReflectionProviderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
use PHPStan\Reflection\BetterReflection\Reflector\MemoizingClassReflector;
use PHPStan\Reflection\BetterReflection\Reflector\MemoizingConstantReflector;
use PHPStan\Reflection\BetterReflection\Reflector\MemoizingFunctionReflector;
use PHPStan\Reflection\BetterReflection\SourceLocator\AutoloadSourceLocator;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Reflection\Runtime\RuntimeReflectionProvider;
use Roave\BetterReflection\Reflector\FunctionReflector;
use Roave\BetterReflection\SourceLocator\Ast\Locator;
use Roave\BetterReflection\SourceLocator\SourceStubber\PhpStormStubsSourceStubber;
use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator;
use Roave\BetterReflection\SourceLocator\Type\MemoizingSourceLocator;
use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator;

Expand Down Expand Up @@ -77,13 +75,10 @@ private function createPhpStormStubsReflectionProvider(): ReflectionProvider
$astLocator = new Locator($this->parser, static function () use (&$functionReflector): FunctionReflector {
return $functionReflector;
});
$sourceLocator = new MemoizingSourceLocator(new AggregateSourceLocator([
new AutoloadSourceLocator($astLocator),
new PhpInternalSourceLocator(
$astLocator,
$this->phpStormStubsSourceStubber
),
]));
$sourceLocator = new MemoizingSourceLocator(new PhpInternalSourceLocator(
$astLocator,
$this->phpStormStubsSourceStubber
));
$classReflector = new MemoizingClassReflector($sourceLocator);
$functionReflector = new MemoizingFunctionReflector($sourceLocator, $classReflector);
$constantReflector = new MemoizingConstantReflector($sourceLocator, $classReflector);
Expand Down

0 comments on commit cf78035

Please sign in to comment.