diff --git a/conf/config.neon b/conf/config.neon index 3c183f59bf..d4b92dd5b2 100644 --- a/conf/config.neon +++ b/conf/config.neon @@ -1612,6 +1612,10 @@ services: stubPhpDocProvider: class: PHPStan\PhpDoc\StubPhpDocProvider + factory: @PHPStan\PhpDoc\StubPhpDocProviderFactory::create() + + - + class: PHPStan\PhpDoc\StubPhpDocProviderFactory arguments: stubFiles: %stubFiles% diff --git a/src/PhpDoc/StubPhpDocProviderFactory.php b/src/PhpDoc/StubPhpDocProviderFactory.php new file mode 100644 index 0000000000..7b83eae369 --- /dev/null +++ b/src/PhpDoc/StubPhpDocProviderFactory.php @@ -0,0 +1,42 @@ +parser = $parser; + $this->fileTypeMapper = $fileTypeMapper; + $this->stubFiles = $stubFiles; + } + + public function create(): StubPhpDocProvider + { + return new StubPhpDocProvider( + $this->parser, + $this->fileTypeMapper, + $this->stubFiles + ); + } + +}