Skip to content

Commit

Permalink
PHP error : undefined array key handled
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulgupta-acquia committed Jan 18, 2025
1 parent 8edc651 commit 7b933c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,10 @@ protected function promptChooseAcsfSite(EnvironmentResponse $cloudEnvironment):
foreach ($acsfSites['sites'] as $domain => $acsfSite) {
$choices[] = "{$acsfSite['name']} ($domain)";
}
if (!count($choices)) {
throw new AcquiaCliException("Could not get ACSF sites");
}

$choice = $this->io->choice('Choose a site', $choices, $choices[0]);
$key = array_search($choice, $choices, true);
$sites = array_values($acsfSites['sites']);
Expand Down

0 comments on commit 7b933c8

Please sign in to comment.