Check value isset to avoid PHP notice

This commit is contained in:
Leevi Graham 2019-10-25 21:23:51 +11:00 committed by Leevi Graham
parent 2ecd7936b1
commit c9072c70ef
1 changed files with 1 additions and 1 deletions

View File

@ -229,7 +229,7 @@ class SymfonyStyle extends OutputStyle
{
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));