Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function execute()
 {
     if ($this->mapping->isLoaded()) {
         return;
     }
     $this->mapping->load($this->containingPackage, $this->packages);
     $packageName = $this->containingPackage->getName();
     $this->mappings->add($this->mapping);
     foreach ($this->mapping->listRepositoryPaths() as $repositoryPath) {
         $this->mappingsByResource->set($repositoryPath, $this->mapping);
         $this->conflictDetector->claim($repositoryPath, $packageName);
     }
 }
 public function testCheckAllTokensIfNoTokensPassed()
 {
     $this->detector->claim('A', 'package1');
     $this->detector->claim('A', 'package2');
     $conflicts = $this->detector->detectConflicts();
     $this->assertCount(1, $conflicts);
     $this->assertInstanceOf('Puli\\Manager\\Conflict\\PackageConflict', $conflicts[0]);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function rollback()
 {
     if ($this->mapping->isLoaded() || !$this->containingPackage) {
         return;
     }
     $this->mapping->load($this->containingPackage, $this->packages);
     $packageName = $this->containingPackage->getName();
     foreach ($this->mapping->listRepositoryPaths() as $repositoryPath) {
         $this->mappings->add($this->mapping);
         $this->conflictDetector->claim($repositoryPath, $packageName);
     }
     // Restore conflicts
     foreach ($this->conflicts as $repositoryPath => $conflict) {
         $conflict->addMappings($this->conflictingMappings[$repositoryPath]);
     }
 }