diff --git a/src/Composer/Repository/InstalledRepository.php b/src/Composer/Repository/InstalledRepository.php index d7ffe92d1..7405a30bb 100644 --- a/src/Composer/Repository/InstalledRepository.php +++ b/src/Composer/Repository/InstalledRepository.php @@ -165,6 +165,18 @@ class InstalledRepository extends CompositeRepository } } + // List conflicts against X as they may explain why the current version was selected, or explain why it is rejected if the conflict matched when inverting + foreach ($package->getConflicts() as $link) { + if (in_array($link->getTarget(), $needles)) { + foreach ($this->findPackages($link->getTarget()) as $pkg) { + $version = new Constraint('=', $pkg->getVersion()); + if ($link->getConstraint()->matches($version) === $invert) { + $results[] = array($package, $link, false); + } + } + } + } + // When inverting, we need to check for conflicts of the needles' requirements against installed packages if ($invert && $constraint && in_array($package->getName(), $needles) && $constraint->matches(new Constraint('=', $package->getVersion()))) { foreach ($package->getRequires() as $link) {