From bbdbb3517b59802390f74e47a499c6faf5149117 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 29 Jan 2020 18:00:56 +0100 Subject: [PATCH] PoolBuilder: Drop name constraints loop, already set earlier in same code --- src/Composer/DependencyResolver/PoolBuilder.php | 10 +--------- .../Test/Fixtures/installer/solver-problems.test | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Composer/DependencyResolver/PoolBuilder.php b/src/Composer/DependencyResolver/PoolBuilder.php index dad0da6ba..3b11de76e 100644 --- a/src/Composer/DependencyResolver/PoolBuilder.php +++ b/src/Composer/DependencyResolver/PoolBuilder.php @@ -86,18 +86,10 @@ class PoolBuilder } $loadNames[$packageName] = $constraint; + // TODO do we even need to set these in name constraints or can we skip them entirely? $this->nameConstraints[$packageName] = $constraint ? new MultiConstraint(array($constraint), false) : null; } - // all the merged constraints from install requests + fixed packages can be applied - // when loading package metadata already, as these are set in stone - foreach ($this->nameConstraints as $package => $constraint) { - if ($constraint !== null && array_key_exists($package, $loadNames)) { - $loadNames[$package] = $constraint; - unset($this->nameConstraints[$package]); - } - } - // clean up loadNames for anything we manually marked loaded above foreach ($loadNames as $name => $void) { if (isset($this->loadedNames[$name])) { diff --git a/tests/Composer/Test/Fixtures/installer/solver-problems.test b/tests/Composer/Test/Fixtures/installer/solver-problems.test index 11aede917..005047127 100644 --- a/tests/Composer/Test/Fixtures/installer/solver-problems.test +++ b/tests/Composer/Test/Fixtures/installer/solver-problems.test @@ -116,8 +116,6 @@ Your requirements could not be resolved to an installable set of packages. - Root composer.json requires unstable/package 2.*, found unstable/package[2.0.0-alpha] but it does not match your minimum-stability. Problem 3 - Root composer.json requires non-existent/pkg, it could not be found in any version, there may be a typo in the package name. - Problem 4 - - The requested package dependency/pkg could not be found in any version, there may be a typo in the package name. Problem 4 - Root composer.json requires stable-requiree-excluded/pkg 1.0.1, found stable-requiree-excluded/pkg[1.0.1] but the package is fixed to 1.0.0 (lock file version) by a partial update and that version does not match. Make sure you whitelist it for update. Problem 5