From dc59af555aadcf52ff74735de571f5f5e3318560 Mon Sep 17 00:00:00 2001 From: Sascha Egerer Date: Wed, 12 Dec 2018 17:27:26 +0100 Subject: [PATCH] Fix invalid call to array_merge --- src/Composer/Installer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 12f071c51..2046dd1da 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -1323,7 +1323,7 @@ class Installer foreach ($this->updateWhitelist as $packageName => $void) { $packageQueue = new \SplQueue; - $depPackages = $pool->whatProvides($packageName); + $depPackages = [$pool->whatProvides($packageName)]; $nameMatchesRequiredPackage = in_array($packageName, $requiredPackageNames, true); @@ -1332,12 +1332,14 @@ class Installer $whitelistPatternRegexp = BasePackage::packageNameToRegexp($packageName); foreach ($rootRequiredPackageNames as $rootRequiredPackageName) { if (preg_match($whitelistPatternRegexp, $rootRequiredPackageName)) { - $depPackages = array_merge($pool->whatProvides($rootRequiredPackageName)); + $depPackages[] = $pool->whatProvides($rootRequiredPackageName); $nameMatchesRequiredPackage = true; } } } + $depPackages = array_merge(...$depPackages); + if (count($depPackages) == 0 && !$nameMatchesRequiredPackage && !in_array($packageName, array('nothing', 'lock', 'mirrors'))) { $this->io->writeError('Package "' . $packageName . '" listed for update is not installed. Ignoring.'); }