From 26877285add6c2d716b1d7cfdc8dcefab112d79f Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Tue, 5 May 2020 20:27:07 +0200 Subject: [PATCH] Filter duplicate packages --- src/Composer/DependencyResolver/PoolBuilder.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Composer/DependencyResolver/PoolBuilder.php b/src/Composer/DependencyResolver/PoolBuilder.php index 634256cb1..f71824c85 100644 --- a/src/Composer/DependencyResolver/PoolBuilder.php +++ b/src/Composer/DependencyResolver/PoolBuilder.php @@ -205,6 +205,16 @@ class PoolBuilder $this->unacceptableFixedPackages = $prePoolCreateEvent->getUnacceptableFixedPackages(); } + // Filter duplicate packages + $presentPackages = array(); + foreach ($this->packages as $i => $package) { + if (isset($presentPackages[$package->getUniqueName()])) { + unset($this->packages[$i]); + } else { + $presentPackages[$package->getUniqueName()] = true; + } + } + $pool = new Pool($this->packages, $this->unacceptableFixedPackages); $this->aliasMap = array();