1
0
Fork 0

Fix invalid call to array_merge

pull/7927/head
Sascha Egerer 2018-12-12 17:27:26 +01:00 committed by Jordi Boggiano
parent 50cb5fe3da
commit dc59af555a
1 changed files with 4 additions and 2 deletions

View File

@ -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('<warning>Package "' . $packageName . '" listed for update is not installed. Ignoring.</warning>');
}