Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab74e56

Browse files
authored
Check value isset to avoid PHP notice
1 parent b9f6944 commit ab74e56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function choice($question, array $choices, $default = null)
229229
{
230230
if (null !== $default) {
231231
$values = array_flip($choices);
232-
$default = $values[$default];
232+
$default = isset($values[$default]) ? $values[$default] : $default;
233233
}
234234

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

0 commit comments

Comments
 (0)