File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/NodeTypeResolver/Reflection/BetterReflection/SourceLocatorProvider Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 88use PHPStan \BetterReflection \SourceLocator \Type \SourceLocator ;
99use PHPStan \Reflection \BetterReflection \SourceLocator \FileNodesFetcher ;
1010use PHPStan \Reflection \BetterReflection \SourceLocator \OptimizedDirectorySourceLocatorFactory ;
11- use PHPStan \Reflection \BetterReflection \SourceLocator \OptimizedSingleFileSourceLocator ;
1211use Rector \Contract \DependencyInjection \ResettableInterface ;
1312use Rector \Testing \PHPUnit \StaticPHPUnitEnvironment ;
1413
@@ -31,7 +30,8 @@ final class DynamicSourceLocatorProvider implements ResettableInterface
3130
3231 public function __construct (
3332 private readonly FileNodesFetcher $ fileNodesFetcher ,
34- private readonly OptimizedDirectorySourceLocatorFactory $ optimizedDirectorySourceLocatorFactory
33+ private readonly OptimizedDirectorySourceLocatorFactory $ optimizedDirectorySourceLocatorFactory ,
34+ private readonly \PHPStan \Reflection \BetterReflection \SourceLocator \OptimizedSingleFileSourceLocatorRepository $ optimizedSingleFileSourceLocatorRepository
3535 ) {
3636 }
3737
@@ -68,7 +68,7 @@ public function provide(): SourceLocator
6868 $ sourceLocators = [];
6969
7070 foreach ($ this ->filePaths as $ file ) {
71- $ sourceLocators [] = new OptimizedSingleFileSourceLocator ( $ this ->fileNodesFetcher , $ file );
71+ $ sourceLocators [] = $ this ->optimizedSingleFileSourceLocatorRepository -> getOrCreate ( $ file );
7272 }
7373
7474 foreach ($ this ->directories as $ directory ) {
You can’t perform that action at this time.
0 commit comments