Example #1
0
 /**
  * {@inheritdoc}
  */
 public function execute()
 {
     if (!$this->repositoryPaths) {
         // Check all paths if none are passed
         $this->repositoryPaths = $this->conflicts->getRepositoryPaths();
     }
     // Mark all as resolved
     foreach ($this->repositoryPaths as $repositoryPath) {
         if ($this->conflicts->has($repositoryPath)) {
             $conflict = $this->conflicts->get($repositoryPath);
             $this->conflicts->remove($repositoryPath);
             $this->removedConflicts[$repositoryPath] = $conflict->getMappings();
             $conflict->resolve();
         }
     }
     $packageConflicts = $this->conflictDetector->detectConflicts($this->repositoryPaths);
     $this->deduplicatePackageConflicts($packageConflicts);
     foreach ($packageConflicts as $packageConflict) {
         $repositoryPath = $packageConflict->getConflictingToken();
         $conflict = new PathConflict($repositoryPath);
         foreach ($packageConflict->getPackageNames() as $packageName) {
             $conflict->addMapping($this->mappingsByResource->get($repositoryPath, $packageName));
         }
         $this->conflicts->add($conflict);
         $this->addedConflicts[] = $repositoryPath;
     }
 }