think\console\output\Ask::run PHP Метод

run() публичный Метод

public run ( )
    public function run()
    {
        if (!$this->input->isInteractive()) {
            return $this->question->getDefault();
        }
        if (!$this->question->getValidator()) {
            return $this->doAsk();
        }
        $that = $this;
        $interviewer = function () use($that) {
            return $that->doAsk();
        };
        return $this->validateAttempts($interviewer);
    }

Usage Example

Пример #1
0
 protected function askQuestion(Input $input, Question $question)
 {
     $ask = new Ask($input, $this, $question);
     $answer = $ask->run();
     if ($input->isInteractive()) {
         $this->newLine();
     }
     return $answer;
 }