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

Skip to content

Commit 81fa862

Browse files
committed
Check value isset to avoid PHP notice
1 parent 6c3924c commit 81fa862

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
@@ -290,7 +290,7 @@ public function choice(string $question, array $choices, $default = null)
290290
{
291291
if (null !== $default) {
292292
$values = array_flip($choices);
293-
$default = $values[$default];
293+
$default = isset($values[$default]) ? $values[$default] : $default;
294294
}
295295

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

0 commit comments

Comments
 (0)