You are here

public function ConfirmationQuestion::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Question/ConfirmationQuestion.php \Symfony\Component\Console\Question\ConfirmationQuestion::__construct()

Constructor.

Parameters

string $question The question to ask to the user:

bool $default The default answer to return, true or false:

string $trueAnswerRegex A regex to match the "yes" answer:

Overrides Question::__construct

File

vendor/symfony/console/Question/ConfirmationQuestion.php, line 30

Class

ConfirmationQuestion
Represents a yes/no question.

Namespace

Symfony\Component\Console\Question

Code

public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i') {
  parent::__construct($question, (bool) $default);
  $this->trueAnswerRegex = $trueAnswerRegex;
  $this
    ->setNormalizer($this
    ->getDefaultNormalizer());
}