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); }
protected function askQuestion(Input $input, Question $question) { $ask = new Ask($input, $this, $question); $answer = $ask->run(); if ($input->isInteractive()) { $this->newLine(); } return $answer; }