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 29, 2019
1 parent 2ecd793 commit c9072c7
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 @@ -229,7 +229,7 @@ public function choice($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 c9072c7

Please sign in to comment.