/** * {@inheritdoc} */ protected function interact(InputInterface $input, OutputInterface $output) { parent::interact($input, $output); // Fill up questions if ($this->informationCollector->hasMissingInformation()) { foreach ($this->informationCollector->getInteractiveQuestions() as $name => $question) { $answer = $this->getOutput()->askQuestion($question, null, $this->input); $this->informationCollector->setValueFor($name, $answer); $this->getOutput()->writeEmptyLine(); } } }
/** * Executed only when we are in interactive mode * * {@inheritdoc} */ protected function interact(InputInterface $input, OutputInterface $output) { parent::interact($input, $output); // Fill up questions if (Context::get('information-collector')->hasMissingInformation()) { $questions = Context::get('information-collector')->getInteractiveQuestions(); $this->getOutput()->writeSmallTitle('Information collect (' . count($questions) . ' questions)'); $this->getOutput()->indent(); $count = 1; foreach ($questions as $name => $question) { $answer = $this->getOutput()->askQuestion($question, $count++, $this->input); Context::get('information-collector')->setValueFor($name, $answer); $this->getOutput()->writeEmptyLine(); } $this->getOutput()->unIndent(); } }