sourceIndex = $sourceIndex; $this->dependenciesIndex = $dependenciesIndex; $this->composerJson = $composerJson; parent::__construct(); } /** * @return ReadableIndex[] */ protected function getIndexes(): array { return [$this->sourceIndex, $this->dependenciesIndex]; } /** * @param string $uri * @return Index */ public function getIndexForUri(string $uri): Index { if (\LanguageServer\uriInVendorDir($this->composerJson, $uri, $matches)) { $packageName = $matches[1]; return $this->dependenciesIndex->getDependencyIndex($packageName); } return $this->sourceIndex; } }