Puli\Manager\Repository\RepositoryManagerImpl::getPathMapping PHP Метод

getPathMapping() публичный Метод

public getPathMapping ( $repositoryPath, $moduleName )
    public function getPathMapping($repositoryPath, $moduleName)
    {
        Assert::string($repositoryPath, 'The repository path must be a string. Got: %s');
        Assert::string($moduleName, 'The module name must be a string. Got: %s');
        $this->assertMappingsLoaded();
        if (!$this->mappings->contains($repositoryPath, $moduleName)) {
            throw NoSuchPathMappingException::forRepositoryPathAndModule($repositoryPath, $moduleName);
        }
        return $this->mappings->get($repositoryPath, $moduleName);
    }

Usage Example

 /**
  * @expectedException \Puli\Manager\Api\Repository\NoSuchPathMappingException
  */
 public function testGetPathMappingFailsIfNotFoundInPackage()
 {
     $this->initDefaultManager();
     $this->packageFile1->addPathMapping($mapping2 = new PathMapping('/path', 'resources'));
     $this->manager->getPathMapping('/path', 'vendor/root');
 }