Skip to content

Commit

Permalink
Fix display of conflicts when a rule has the conflicter out of order, f…
Browse files Browse the repository at this point in the history
…ixes #10355
  • Loading branch information
Seldaek committed Dec 19, 2021
1 parent 239638e commit d812982
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/DependencyResolver/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ public function getSourcePackage(Pool $pool)
$package1 = $this->deduplicateDefaultBranchAlias($pool->literalToPackage($literals[0]));
$package2 = $this->deduplicateDefaultBranchAlias($pool->literalToPackage($literals[1]));

$conflictTarget = $package1->getPrettyString();
if ($reasonData = $this->getReasonData()) {
// swap literals if they are not in the right order with package2 being the conflicter
if ($reasonData->getSource() === $package1->getName()) {
Expand Down Expand Up @@ -313,6 +312,7 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request,
// swap literals if they are not in the right order with package2 being the conflicter
if ($reasonData->getSource() === $package1->getName()) {
list($package2, $package1) = array($package1, $package2);
$conflictTarget = $package1->getPrettyName().' '.$reasonData->getPrettyConstraint();
}

// if the conflict is not directly against the package but something it provides/replaces,
Expand Down

0 comments on commit d812982

Please sign in to comment.