public function askInput($questionText, $default = null, array $autoCompleterValues = [], callable $validator = null)
    {
        if ($default !== null) {
            $questionText .= ' <question>[' . $default . ']</question>';
        }
        $questionText .= ': ';
        $question = new Question($questionText, $default);
        if (!empty($autoCompleterValues)) {
            $question->setAutocompleterValues($autoCompleterValues);
        }
        if ($validator !== null) {
            $question->setValidator($validator);
            $question->setMaxAttempts(5);
        }

        return $this->ask($this->input, $this->output, $question);
    }
public function askInput($questionText, $default = null, array $autoCompleterValues = [], callable $validator = null)
    {
        if ($default !== null) {
            $questionText .= ' <question>[' . $default . ']</question>';
        }
        $questionText .= ': ';
        $question = new Question($questionText, $default);
        if (!empty($autoCompleterValues)) {
            $question->setAutocompleterValues($autoCompleterValues);
        }
        if ($validator !== null) {
            $question->setValidator($validator);
            $question->setMaxAttempts(5);
        }

        return $this->ask($this->input, $this->output, $question);
    }
public function askInput ( $ questionText , $ default = null , array $ autoCompleterValues = [ ] , callable $ validator = null ) { if ( $ default !== null ) { $ questionText .= ' <question>[' . $ default . ']</question>' ; } $ questionText .= ': ' ; $ question = new Question ( $ questionText , $ default ) ; if ( ! empty ( $ autoCompleterValues ) ) { $ question -> setAutocompleterValues ( $ autoCompleterValues ) ; } if ( $ validator !== null ) { $ question -> setValidator ( $ validator ) ; $ question -> setMaxAttempts ( 5 ) ; } return $ this -> ask ( $ this -> input , $ this -> output , $ question ) ; }
Ask a simple question which requires input.

@param string   $questionText
@param mixed    $default
@param array    $autoCompleterValues
@param callable $validator

@return string
The user's answer.
Ask a simple question which requires input .