/** * 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(); }
/** * Add a path conflict to the collection. * * @param PathConflict $conflict The path conflict */ public function add(PathConflict $conflict) { $this->conflicts[$conflict->getRepositoryPath()] = $conflict; }