To ask question

@param      $question
@param null $default
@param null $validator
541575
protected function ask($question, $default = null, $validator = null)
    {
        return $this->output->ask($question, $default, $validator);
    }
293066
public static function input($question, $default = null)
    {
        echo $question.': ';
        $handle = fopen ('php://stdin', 'r');

        $answer = fgets($handle);
        fclose($handle);

        $answer = trim($answer);

        if(!$answer) {
            $answer = $default;
        }

        return $answer;
    }
1125525
def ask(question, default=None):
    
    question = str(question)

    if default:
        question += ' [' + str(default) + ']'

    question += ': '

    reply = raw_input(question)
    return reply if reply else default
1075761
public function in(string $question, string $default = '')
    {
        $input = $this->climate->input($question);
        return $input->prompt() ?: $default;
    }
800448
public function askWithCompletion($question, array $choices, $default = null)
    {
        $helper = $this->getHelperSet()->get('question');

        $question = new Question("<question>$question</question> ", $default);

        $question->setAutocompleterValues($choices);

        return $helper->ask($this->input, $this->output, $question);
    }
934688
protected function ask($question)
    {
        $helper = $this->getHelper('question');
        $question = new Question("<question>{$question}</question>");

        return $helper->ask($this->input, $this->output, $question);
    }
129295
public function ask($question)
    {
        //Show required message
        echo "\n";
        echo "\t", $this->colorize($question, 'info');
        echo "\n";
        //Get user input
        echo "\t"; $response = trim(fgets(STDIN));

        return $response;
    }
259413
public function setupQuestion($question)
    {
        $user = new User($this->db);
        $post = new Post($this->db);

        $question->img = $user->getGravatar($question->user);
        $question->title = $this->getMD($question->title);
        $question->tags = explode(',', $question->tags);

        $question->question = $post->getPost("questionId = ? AND type = ?", [$question->id, "question"]);
        $question->answers = $post->getAllPosts("questionId = ? AND type = ?", [$question->id, "answer"]);
        $question->answerCount = count($question->answers);


        return $question;
    }
1295360
public function ask(string $question, $default = null)
	{
		$this->output->write(trim($question) . ' ');

		$answer = $this->input->read();

		return empty($answer) ? $default : $answer;
	}
1168993
private function askAndValidate(InputInterface $input, OutputInterface $output, $questionText, $default, $validator)
    {
        $questionHelper = $this->getQuestionHelper();

        // NEXT_MAJOR: Remove this BC code for SensioGeneratorBundle 2.3/2.4 after dropping support for Symfony 2.3
        if ($questionHelper instanceof DialogHelper) {
            return $questionHelper->askAndValidate($output, $questionHelper->getQuestion($questionText, $default), $validator, false, $default);
        }

        $question = new Question($questionHelper->getQuestion($questionText, $default), $default);

        $question->setValidator($validator);

        return $questionHelper->ask($input, $output, $question);
    }
900495
public function confirm($questionText, $default = true)
    {
        $questionText .= ' <question>' . ($default ? '[Y/n]' : '[y/N]') . '</question> ';

        $yes = $this->input->hasOption('yes') && $this->input->getOption('yes');
        $no = $this->input->hasOption('no') && $this->input->getOption('no');
        if ($yes && !$no) {
            $this->output->writeln($questionText . 'y');
            return true;
        } elseif ($no && !$yes) {
            $this->output->writeln($questionText . 'n');
            return false;
        } elseif (!$this->input->isInteractive()) {
            $this->output->writeln($questionText . ($default ? 'y' : 'n'));
            return $default;
        }
        $question = new ConfirmationQuestion($questionText, $default);

        return $this->ask($this->input, $this->output, $question);
    }
696864
public function askQuestion(InteractiveQuestion $question, $position = null, InputInterface $input = null)
    {
        $text = ($position !== null ? $position .') ' : null) . $question->getFormatedText();

        if ($this->dialogHelper instanceof QuestionHelper) {
            if (!$input) {
                throw new \InvalidArgumentException('With symfony 3, the input stream may not be null');
            }
            $q = new Question($text, $question->getDefault());
            $q->setValidator($question->getValidator());
            if ($question->isHiddenAnswer()) {
                $q->setHidden(true);
            }

            return $this->dialogHelper->ask($input, $this, $q);
        }

        if ($this->dialogHelper instanceof DialogHelper) {

            if ($question->isHiddenAnswer()) {
                return $this->dialogHelper->askHiddenResponseAndValidate($this, $text, $question->getValidator(), false);
            }

            return $this->dialogHelper->askAndValidate($this, $text, $question->getValidator(), false, $question->getDefault());
        }

        throw new \RuntimeException("Invalid dialogHelper");
    }
200394
protected function prompt($question, $default)
    {
        try {
            return \cli\prompt($question, $default);
        } catch (\Exception $e) {
            WP_CLI::error($e->getMessage());
            die;
        }
    }
391999
public function in(string $question, string $default = '')
    {
        $formatted = sprintf('%s (%s):', $question, $default);

        return $this->handler->in($formatted, $default);
    }
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];
	}
567588
protected function getFormattedSimpleQuestion($question, $default, array $options)
    {
        $question .= '%s';
        $question = sprintf(
            $question,
            ($options ? ' ('.implode('/', $options).')' : '')
        );

        return $question;
    }
1136485
private function askConfirmation(InputInterface $input, OutputInterface $output, $question, $default)
    {
        if (!class_exists(ConfirmationQuestion::class)) {
            $dialog = $this->getHelperSet()->get('dialog');

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

        $questionHelper = $this->getHelperSet()->get('question');
        $question = new ConfirmationQuestion($question, $default);

        return $questionHelper->ask($input, $output, $question);
    }