1
0
Fork 0

fix: cast null to array before passing to array_merge() (#666)

Fixes #595
pull/636/merge v5.4.2
janekcz69 2018-08-22 20:48:14 +02:00 committed by Felix Becker
parent 26e3451e61
commit 3931c8848f
2 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ class Indexer
$packageKey = null; $packageKey = null;
$cacheKey = null; $cacheKey = null;
$index = null; $index = null;
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) { foreach (array_merge($this->composerLock->packages, (array)$this->composerLock->{'packages-dev'}) as $package) {
// Check if package name matches and version is absolute // Check if package name matches and version is absolute
// Dynamic constraints are not cached, because they can change every time // Dynamic constraints are not cached, because they can change every time
$packageVersion = ltrim($package->version, 'v'); $packageVersion = ltrim($package->version, 'v');

View File

@ -169,7 +169,7 @@ class Workspace
return []; return [];
} }
$dependencyReferences = []; $dependencyReferences = [];
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) { foreach (array_merge($this->composerLock->packages, (array)$this->composerLock->{'packages-dev'}) as $package) {
$dependencyReferences[] = new DependencyReference($package); $dependencyReferences[] = new DependencyReference($package);
} }
return $dependencyReferences; return $dependencyReferences;