protected function execute(InputInterface $input, OutputInterface $output) { $state = parent::execute($input, $output); $image = $input->getOption("image"); if ($image) { $parts = explode('.', $image); (new Printer\GraphViz())->printCfg($state->blocks)->export(end($parts), $image); } else { echo (new Printer\Text())->printCfg($state->blocks); } }
protected function execute(InputInterface $input, OutputInterface $output) { $components = parent::execute($input, $output); $image = $input->getOption("image"); if ($image) { $parts = explode('.', $image); (new Printer\GraphViz())->printVars($components['cfg'])->export(end($parts), $image); } else { echo (new Printer\Text())->printVars($components['cfg']); } }
protected function execute(InputInterface $input, OutputInterface $output) { $components = parent::execute($input, $output); $this->loadRules(); $errors = []; foreach ($this->rules as $rule) { echo "Executing rule: " . $rule->getName() . "\n"; $errors = array_merge($errors, $rule->execute($components)); } foreach ($errors as $error) { $this->emitError($error[0], $error[1]); } }