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 { $packageName = getPackageName($uri, $this->composerJson); if ($packageName) { return $this->dependenciesIndex->getDependencyIndex($packageName); } return $this->sourceIndex; } }