/** * @return \Symfony\Component\Console\Helper\DialogHelper */ public function getDialogHelper() { $dialog = new \Symfony\Component\Console\Helper\DialogHelper(); $helperSet = new HelperSet(array(new FormatterHelper())); $dialog->setHelperSet($helperSet); $dialog->setInputStream($this->getInputStream()); return $dialog; }
protected function loadRoboFile() { if (!file_exists($this->file)) { $this->output->writeln(sprintf('<comment>%s could not be found</comment>', $this->file)); $dialog = new \Symfony\Component\Console\Helper\DialogHelper(); if ($dialog->askConfirmation($this->output, sprintf("<question>Should I create %s? (y/n)</question> ", $this->file), false)) { $this->initRoboFile(); } exit; } require_once $this->file; if (!class_exists(self::ROBOCLASS)) { $this->output->writeln("<error>Class " . self::ROBOCLASS . " was not loaded</error>"); return false; } return true; }