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

Breadcrumb

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

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

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal