Skip to content

Commit 767b8c0

Browse files
gnito-orgnicolas-grekas
authored andcommitted
[Flex] Fix Composer update exception when flex://defaults missing
1 parent 99e3323 commit 767b8c0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Cache.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ private function getVersions(): array
130130
$this->downloader = null;
131131
$okVersions = [];
132132

133+
if (!isset($versions['splits'])) {
134+
throw new \LogicException('The Flex index is missing a "splits" entry. Did you forget to add "flex://defaults" in the "extra.symfony.endpoint" array of your composer.json?');
135+
}
133136
foreach ($versions['splits'] as $name => $vers) {
134137
foreach ($vers as $i => $v) {
135138
if (!isset($okVersions[$v])) {

src/PackageFilter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ private function getVersions(): array
122122
$this->downloader = null;
123123
$okVersions = [];
124124

125+
if (!isset($versions['splits'])) {
126+
throw new \LogicException('The Flex index is missing a "splits" entry. Did you forget to add "flex://defaults" in the "extra.symfony.endpoint" array of your composer.json?');
127+
}
125128
foreach ($versions['splits'] as $name => $vers) {
126129
foreach ($vers as $i => $v) {
127130
if (!isset($okVersions[$v])) {

0 commit comments

Comments
 (0)