Skip to content

Commit 3931c88

Browse files
netjanfelixfbecker
authored andcommitted
fix: cast null to array before passing to array_merge() (#666)
Fixes #595
1 parent 26e3451 commit 3931c88

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Indexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function index(): Promise
147147
$packageKey = null;
148148
$cacheKey = null;
149149
$index = null;
150-
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
150+
foreach (array_merge($this->composerLock->packages, (array)$this->composerLock->{'packages-dev'}) as $package) {
151151
// Check if package name matches and version is absolute
152152
// Dynamic constraints are not cached, because they can change every time
153153
$packageVersion = ltrim($package->version, 'v');

src/Server/Workspace.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function xdependencies(): array
169169
return [];
170170
}
171171
$dependencyReferences = [];
172-
foreach (array_merge($this->composerLock->packages, $this->composerLock->{'packages-dev'}) as $package) {
172+
foreach (array_merge($this->composerLock->packages, (array)$this->composerLock->{'packages-dev'}) as $package) {
173173
$dependencyReferences[] = new DependencyReference($package);
174174
}
175175
return $dependencyReferences;

0 commit comments

Comments
 (0)