From 2e64e8dc2e7af24b619d4cb6fc5fe2279000fe25 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 8 Apr 2020 14:18:38 +0200 Subject: [PATCH] Avoid generating duplicate aliases in lock file if several aliased packages are installed --- src/Composer/DependencyResolver/LockTransaction.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/DependencyResolver/LockTransaction.php b/src/Composer/DependencyResolver/LockTransaction.php index e9c7fea2e..0e0eb0c7a 100644 --- a/src/Composer/DependencyResolver/LockTransaction.php +++ b/src/Composer/DependencyResolver/LockTransaction.php @@ -122,9 +122,10 @@ class LockTransaction extends Transaction foreach ($this->resultPackages['all'] as $package) { if ($package instanceof AliasPackage) { - foreach ($aliases as $alias) { + foreach ($aliases as $index => $alias) { if ($alias['package'] === $package->getName()) { $usedAliases[] = $alias; + unset($aliases[$index]); } } }