/**
  * {@inheritdoc}
  */
 public function getPathMapping($repositoryPath, $packageName)
 {
     Assert::string($repositoryPath, 'The repository path must be a string. Got: %s');
     Assert::string($packageName, 'The package name must be a string. Got: %s');
     $this->assertMappingsLoaded();
     if (!$this->mappings->contains($repositoryPath, $packageName)) {
         throw NoSuchPathMappingException::forRepositoryPathAndPackage($repositoryPath, $packageName);
     }
     return $this->mappings->get($repositoryPath, $packageName);
 }
Example #2
0
 /**
  * Returns the path mapping for a repository path.
  *
  * @param string $repositoryPath The repository path.
  *
  * @return PathMapping The corresponding path mapping.
  *
  * @throws NoSuchPathMappingException If the repository path is not mapped.
  */
 public function getPathMapping($repositoryPath)
 {
     if (!isset($this->pathMappings[$repositoryPath])) {
         throw NoSuchPathMappingException::forRepositoryPath($repositoryPath);
     }
     return $this->pathMappings[$repositoryPath];
 }