Get the question object with a formatted question

@param string          $question
@param string|int|null $default
@param array           $options
@param bool            $required
@return \Symfony\Component\Console\Question\Question
517822
public function getQuestionConfirm(
        $question,
        $default = 'y',
        array $options = array('y', 'n'),
        $required = true
    ) {
        return $this->getQuestion($question, $default, $options, $required);
    }
69282
public function ask(SimpleQuestion $question)
    {
        return $this->question->ask(
            $this->input,
            $this->output,
            new Question(
                $this->buildQuestionText($question),
                $this->getPreResponse($question)
            )
        );
    }
364033
private function getQuestion($question, $default = null, callable $validator = null, array $values = null)
    {
        $question = new Question(
            sprintf('<info>%s</info>%s: ', $question, $default ? sprintf(' [<comment>%s</comment>]', $default) : ''),
            $default
        );

        $question
            ->setValidator($validator)
            ->setAutocompleterValues($values);

        return $question;
    }
1219473
protected function askOptions(string $description, array $options, int $default, $multiSelect = false)
    {
        $helper   = $this->getHelper('question');
        $question = new ChoiceQuestion(
            $description,
            $options,
            $default
        );
        if ($multiSelect) {
            $question->setMultiselect(true);
        }
        $question->setErrorMessage('Answer is invalid');
        $answer = $helper->ask($this->input, $this->output, $question);

        return $answer;
    }
353539
public function ask(string $question, $default = 'n', ?array $options = null)
	{
		$options = $options === null ? ['y' => true, 'n' => false] : $this->normalizeKeys($options);

		$input = parent::ask(trim($question) . ' [' . $this->getOptions($options, $default) . '] ');

		$input = mb_strtolower(empty($input) ? $default : $input);

		if(!isset($options[$input]))
		{
			return $this->ask($question, $default, $options);
		}

		return $options[$input];
	}
103770
private function prompt( $question, $default ) {

		$question .= ': ';
		if ( function_exists( 'readline' ) ) {
			return readline( $question );
		}

		echo $question;

		$ret = stream_get_line( STDIN, 1024, "\n" );
		if ( Utils\is_windows() && "\r" === substr( $ret, -1 ) ) {
			$ret = substr( $ret, 0, -1 );
		}
		return $ret;
	}
441820
public function ask(string $question, array $options): int
	{
		$options = array_values($options);

		$this->output->writeLn(trim($question));

		$this->output->write($this->buildOptionsList($options));

		$key = (int) $this->input->read() - 1;

		if(isset($options[$key]))
		{
			return $key;
		}

		return $this->ask($question, $options);
	}
471089
public function choice($question, array $choices, $default = null)
    {
        $helper = $this->getHelper('question');

        $question = new ChoiceQuestion($question, $choices, $default);

        $question->setMultiselect(true);

        return $helper->ask($this->input, $this->getOutputInterface(), $question);
    }
163937
public function askInput($questionText, $default = null, array $autoCompleterValues = [], callable $validator = null)
    {
        if ($default !== null) {
            $questionText .= ' <question>[' . $default . ']</question>';
        }
        $questionText .= ': ';
        $question = new Question($questionText, $default);
        if (!empty($autoCompleterValues)) {
            $question->setAutocompleterValues($autoCompleterValues);
        }
        if ($validator !== null) {
            $question->setValidator($validator);
            $question->setMaxAttempts(5);
        }

        return $this->ask($this->input, $this->output, $question);
    }
372508
protected function getFormattedListQuestion($question, $default, array $options)
    {
        $list = '';
        foreach ($options as $key => $title) {
            $list .= "  $key - $title".($default == $key ? ' (Default)' : '').PHP_EOL;
        }

        return $question.":\n".$list;
    }
196344
public function confirm($name, $question, $required = false)
    {
        if (is_string($question)) {
            output()->write(
                (new Format())
                    ->setString(rtrim(language()->getLine($question), '?') . ' (Y/N) ?')
                    ->setSpace(1)
            );
        } elseif ($question instanceof Format or $question instanceof Text) {
            output()->write($question . '?');
        }

        $standardInput = strtoupper(input()->standard());

        if ($required === true and ! in_array($standardInput, ['Y', 'N'])) {
            $requiredText = (new Format())
                ->setColor((new Color())->setBackground(Color::RED))
                ->setString(' ' . language()->getLine('REQUIRED') . ' ')
                ->setIndent(1)
                ->__toString();

            $this->confirm($name, str_replace($requiredText, '', $question) . $requiredText, $required);

            return;
        }

        $_POST[ $name ] = (bool)($standardInput === 'Y');
    }
553052
public function askWithCompletion($question, array $choices, $default = null, $attempts = null, $strict = null)
    {
        return $this->output->askWithCompletion($question, $choices, $default, $attempts, $strict);
    }
1075761
public function in(string $question, string $default = '')
    {
        $input = $this->climate->input($question);
        return $input->prompt() ?: $default;
    }
827898
public function ask($question, $verbosity = null, $default = null, array $args = [])
    {
        $message    =   $this->interpolate($question, $args);
        return parent::ask($message, $default);
    }
1350997
protected function question(string $question, $default = null)
	{
		return (new Question($this->input, $this->output))->ask($question, $default);
	}
732766
public function confirm($question, $default = false)
    {
        $que = new ConfirmationQuestion($question, $default);
        $helper = new SymfonyQuestionHelper();
        return $helper->ask($this->input, $this->output, $que);
    }
890116
private function askConfirmation(InputInterface $input, OutputInterface $output, $question, $default = true)
    {
        if ($this->getHelperSet()->has('question')) {
            $question = new ConfirmationQuestion($question, $default);

            return $this->getHelper('question')->ask($input, $output, $question);
        }

        return $this->getHelper('dialog')->askConfirmation($output, $question, $default);
    }