function ConsoleIO::askAndValidate
@inheritDoc
Overrides IOInterface::askAndValidate
File
-
vendor/
composer/ composer/ src/ Composer/ IO/ ConsoleIO.php, line 275
Class
- ConsoleIO
- The Input/Output helper.
Namespace
Composer\IOCode
public function askAndValidate($question, $validator, $attempts = null, $default = null) {
/** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */
$helper = $this->helperSet
->get('question');
$question = new Question($question, $default);
$question->setValidator($validator);
$question->setMaxAttempts($attempts);
return $helper->ask($this->input, $this->getErrorOutput(), $question);
}