function StrictConfirmationQuestion::getDefaultValidator
Returns the default answer validator.
1 call to StrictConfirmationQuestion::getDefaultValidator()
- StrictConfirmationQuestion::__construct in vendor/
composer/ composer/ src/ Composer/ Question/ StrictConfirmationQuestion.php - Constructor.s
File
-
vendor/
composer/ composer/ src/ Composer/ Question/ StrictConfirmationQuestion.php, line 83
Class
- StrictConfirmationQuestion
- Represents a yes/no question Enforces strict responses rather than non-standard answers counting as default Based on Symfony\Component\Console\Question\ConfirmationQuestion
Namespace
Composer\QuestionCode
private function getDefaultValidator() : callable {
return static function ($answer) : bool {
if (!is_bool($answer)) {
throw new InvalidArgumentException('Please answer yes, y, no, or n.');
}
return $answer;
};
}