public function SymfonyStyle::choice in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Style/SymfonyStyle.php \Symfony\Component\Console\Style\SymfonyStyle::choice()
Asks a choice question.
Parameters
string $question:
array $choices:
string|int|null $default:
Return value
string
Overrides StyleInterface::choice
File
- vendor/
symfony/ console/ Style/ SymfonyStyle.php, line 253
Class
- SymfonyStyle
- Output decorator helpers for the Symfony Style Guide.
Namespace
Symfony\Component\Console\StyleCode
public function choice($question, array $choices, $default = null) {
if (null !== $default) {
$values = array_flip($choices);
$default = $values[$default];
}
return $this
->askQuestion(new ChoiceQuestion($question, $choices, $default));
}