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

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

public hasPathMapping ( $repositoryPath, $moduleName )
    public function hasPathMapping($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();
        return $this->mappings->contains($repositoryPath, $moduleName);
    }

Usage Example

 public function testHasPathMapping()
 {
     $this->initDefaultManager();
     $this->rootPackageFile->addPathMapping(new PathMapping('/path1', 'resources'));
     $this->packageFile1->addPathMapping(new PathMapping('/path2', 'resources'));
     $this->assertTrue($this->manager->hasPathMapping('/path1', 'vendor/root'));
     $this->assertTrue($this->manager->hasPathMapping('/path2', 'vendor/package1'));
     $this->assertFalse($this->manager->hasPathMapping('/path1', 'vendor/package1'));
     $this->assertFalse($this->manager->hasPathMapping('/path2', 'vendor/root'));
     $this->assertFalse($this->manager->hasPathMapping('/path3', 'vendor/root'));
 }