1
0
Fork 0

Fix conflict order to be more accurate

pull/8558/head
Jordi Boggiano 2020-01-30 15:51:56 +01:00
parent 1e68555e0a
commit ec90c17e3b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
3 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ abstract class Rule
$package1 = $pool->literalToPackage($literals[0]);
$package2 = $pool->literalToPackage($literals[1]);
return $package1->getPrettyString().' conflicts with '.$this->formatPackagesUnique($pool, array($package2)).'.';
return $package2->getPrettyString().' conflicts with '.$package1->getPrettyString().'.';
case self::RULE_PACKAGE_REQUIRES:
$sourceLiteral = array_shift($literals);

View File

@ -652,7 +652,7 @@ class SolverTest extends TestCase
$msg = "\n";
$msg .= " Problem 1\n";
$msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n";
$msg .= " - B 1.0 conflicts with A[1.0].\n";
$msg .= " - A 1.0 conflicts with B 1.0.\n";
$msg .= " - Root composer.json requires b -> satisfiable by B[1.0].\n";
$this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool));
}

View File

@ -31,7 +31,7 @@ Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires conflicter/pkg 1.0.0 -> satisfiable by conflicter/pkg[1.0.0].
- victim/pkg 1.0.0 conflicts with conflicter/pkg[1.0.0].
- conflicter/pkg 1.0.0 conflicts with victim/pkg 1.0.0.
- Root composer.json requires victim/pkg 1.0.0 -> satisfiable by victim/pkg[1.0.0].
--EXPECT--