From 071350286fb196722728511aecd00e1defa826c7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 15 Jun 2020 13:00:39 +0200 Subject: [PATCH] Compact constraints to avoid ending up with very long multi constraints --- src/Composer/DependencyResolver/PoolBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/DependencyResolver/PoolBuilder.php b/src/Composer/DependencyResolver/PoolBuilder.php index e1a49cd5b..9561bb73f 100644 --- a/src/Composer/DependencyResolver/PoolBuilder.php +++ b/src/Composer/DependencyResolver/PoolBuilder.php @@ -268,7 +268,7 @@ class PoolBuilder } // extend the constraint to be loaded - $constraint = MultiConstraint::create(array($this->packagesToLoad[$name], $constraint), false); + $constraint = Intervals::compactConstraint(MultiConstraint::create(array($this->packagesToLoad[$name], $constraint), false)); } // Not yet loaded or already marked for a reload, override the existing constraint @@ -287,7 +287,7 @@ class PoolBuilder // We have already loaded that package but not in the constraint that's // required. We extend the constraint and mark that package as not being loaded // yet so we get the required package versions - $this->packagesToLoad[$name] = MultiConstraint::create(array($this->loadedPackages[$name], $constraint), false); + $this->packagesToLoad[$name] = Intervals::compactConstraint(MultiConstraint::create(array($this->loadedPackages[$name], $constraint), false)); unset($this->loadedPackages[$name]); }