Skip to content

Commit 7a79135

Browse files
bug #838 [Flex] Fix Composer update exception when flex://defaults missing (gnito-org)
This PR was squashed before being merged into the 1.x branch. Discussion ---------- [Flex] Fix Composer update exception when flex://defaults missing Q | A -- | -- Branch? | 1.x Bug fix? | yes New feature? | no Deprecations? | no Tickets | Fix #836 License | MIT Doc PR | - Commits ------- 767b8c0 [Flex] Fix Composer update exception when flex://defaults missing
2 parents 99e3323 + 767b8c0 commit 7a79135

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)