Skip to content

Commit 6d07b8c

Browse files
committed
feat(index): compatibility to new index file format
1 parent 109b74d commit 6d07b8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Service/IndexFileService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ private function loadPluginInformationFromFile(): void
5454
throw new MalformedIndexException(sprintf('JSON decoding failed: %s', $e->getMessage()), $e->getCode(), $e);
5555
}
5656

57-
foreach ($data as $package => $packageInfo) {
57+
if (!isset($data['extensions']) || !is_array($data['extensions'])) {
58+
throw new MalformedIndexException('Package information is missing.');
59+
}
60+
61+
foreach ($data['extensions'] as $package => $packageInfo) {
5862
if (!isset($packageInfo['repositoryUrl'], $packageInfo['ref'])) {
5963
throw new MalformedIndexException(sprintf('Package information is missing required fields for package: %s', $package));
6064
}

0 commit comments

Comments
 (0)