diff --git a/src/PhpDoc/StubFilesExtension.php b/src/PhpDoc/StubFilesExtension.php new file mode 100644 index 0000000000..961b2f4b89 --- /dev/null +++ b/src/PhpDoc/StubFilesExtension.php @@ -0,0 +1,13 @@ +parser = $parser; $this->fileTypeMapper = $fileTypeMapper; + $this->container = $container; $this->stubFiles = $stubFiles; } public function create(): StubPhpDocProvider { + $stubFiles = $this->stubFiles; + $extensions = $this->container->getServicesByTag(StubFilesExtension::EXTENSION_TAG); + foreach ($extensions as $extension) { + $extensionFiles = $extension->getFiles(); + foreach ($extensionFiles as $extensionFile) { + $stubFiles[] = $extensionFile; + } + } + return new StubPhpDocProvider( $this->parser, $this->fileTypeMapper, - $this->stubFiles + $stubFiles ); }