Skip to content

Commit

Permalink
Check value isset to avoid PHP notice
Browse files Browse the repository at this point in the history
  • Loading branch information
leevigraham committed Oct 27, 2019
1 parent 6c3924c commit 81fa862
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Style/SymfonyStyle.php
Expand Up @@ -290,7 +290,7 @@ public function choice(string $question, array $choices, $default = null)
{
if (null !== $default) {
$values = array_flip($choices);
$default = $values[$default];
$default = isset($values[$default]) ? $values[$default] : $default;
}

return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
Expand Down

0 comments on commit 81fa862

Please sign in to comment.