function Question::setValidator
Sets a validator for the question.
Return value
$this
4 calls to Question::setValidator()
- ChoiceQuestion::setErrorMessage in vendor/
symfony/ console/ Question/ ChoiceQuestion.php - Sets the error message for invalid values.
- ChoiceQuestion::setMultiselect in vendor/
symfony/ console/ Question/ ChoiceQuestion.php - Sets multiselect option.
- ChoiceQuestion::__construct in vendor/
symfony/ console/ Question/ ChoiceQuestion.php - StrictConfirmationQuestion::__construct in vendor/
composer/ composer/ src/ Composer/ Question/ StrictConfirmationQuestion.php - Constructor.s
File
-
vendor/
symfony/ console/ Question/ Question.php, line 192
Class
- Question
- Represents a Question.
Namespace
Symfony\Component\Console\QuestionCode
public function setValidator(?callable $validator) : static {
$this->validator = null === $validator ? null : $validator(...);
return $this;
}