sourceIndex = $sourceIndex; $this->dependenciesIndex = $dependenciesIndex; } /** * @return ReadableIndex[] */ protected function getIndexes(): array { return [$this->sourceIndex, $this->dependenciesIndex]; } /** * @param string $uri * @return Index */ public function getIndexForUri(string $uri): Index { if (preg_match('/\/vendor\/(\w+\/\w+)\//', $uri, $matches)) { $packageName = $matches[0]; return $this->dependenciesIndex->getDependencyIndex($packageName); } return $this->sourceIndex; } }