Skip to content

Commit

Permalink
Added support for recipes conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Dec 20, 2018
1 parent 8ad5578 commit 4d69c55
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,20 @@ private function fetchRecipes(): array
$name = $package->getNames()[0];
$job = $operation->getJobType();

if (!empty($manifests[$name]['manifest']['conflict'])) {
$lockedRepository = $this->composer->getLocker()->getLockedRepository();

foreach ($manifests[$name]['manifest']['conflict'] as $conflictingPackageName => $constraint) {
if ($conflictingPackage = $lockedRepository->findPackage($conflictingPackageName, $constraint)) {
if ($this->io->isVerbose()) {
$this->io->writeError(sprintf(' Recipe for %s conflicts with %s:%s which should not be %s', $name, $conflictingPackageName, $conflictingPackage->getPrettyVersion(), $constraint));
}

continue;
}
}
}

if ($operation instanceof InstallOperation && isset($locks[$name])) {
$this->lock->add($name, $locks[$name]);
} elseif ($operation instanceof UninstallOperation) {
Expand Down

0 comments on commit 4d69c55

Please sign in to comment.