Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Question.php

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\Question

Code

public function setValidator(?callable $validator) : static {
    $this->validator = null === $validator ? null : $validator(...);
    return $this;
}
RSS feed
Powered by Drupal