Liip\RMT\Information\InformationCollector::getInteractiveQuestions PHP Method

getInteractiveQuestions() public method

    public function getInteractiveQuestions()
    {
        $questions = array();
        foreach ($this->requests as $name => $request) {
            if ($request->isAvailableForInteractive() && !$request->hasValue()) {
                $questions[$name] = $request->convertToInteractiveQuestion();
            }
        }
        return $questions;
    }

Usage Example

示例#1
0
 protected function interact(InputInterface $input, OutputInterface $output)
 {
     // Fill up questions
     if ($this->informationCollector->hasMissingInformation()) {
         foreach ($this->informationCollector->getInteractiveQuestions() as $name => $question) {
             $answer = $this->askQuestion($question);
             $this->informationCollector->setValueFor($name, $answer);
             $this->writeEmptyLine();
         }
     }
 }