コード例 #1
0
ファイル: PathMapping.php プロジェクト: sensorario/manager
 /**
  * Removes a conflict from the mapping.
  *
  * The method {@link load()} needs to be called before calling this method,
  * otherwise an exception is thrown.
  *
  * @param PathConflict $conflict The conflict to remove.
  *
  * @throws NotLoadedException If the mapping is not loaded.
  */
 public function removeConflict(PathConflict $conflict)
 {
     if (null === $this->state) {
         throw new NotLoadedException('The mapping is not loaded.');
     }
     $repositoryPath = $conflict->getRepositoryPath();
     if (!isset($this->conflicts[$repositoryPath]) || $conflict !== $this->conflicts[$repositoryPath]) {
         return;
     }
     unset($this->conflicts[$repositoryPath]);
     $conflict->removeMapping($this);
     $this->refreshState();
 }
コード例 #2
0
 /**
  * Add a path conflict to the collection.
  *
  * @param PathConflict $conflict The path conflict
  */
 public function add(PathConflict $conflict)
 {
     $this->conflicts[$conflict->getRepositoryPath()] = $conflict;
 }