/** * Give the user a single choice from an array of answers. * * @param string $question * @param array $choices * @param string $default * @param mixed $attempts * @param bool $multiple * @return string */ public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null) { $question = new ChoiceQuestion($question, $choices, $default); $question->setMaxAttempts($attempts)->setMultiselect($multiple); return $this->output->askQuestion($question); }
/** * Prompt the user for input but hide the answer from the console. * * @param string $question * @param bool $fallback * * @return string */ public function secret($question, $fallback = TRUE) { $question = new Question($question); $question->setHidden(TRUE)->setHiddenFallback($fallback); return $this->output->askQuestion($question); }