/** * {@inheritdoc} */ public function displayResults(OutputStyle $style, $lockFile, array $data, $showTaggedDev) { $style->text("Checked file: <fg=yellow>{$lockFile}</>"); $style->newLine(); $headers = array('Name', 'Local', 'Stable'); $rows = array(); if ($showTaggedDev) { $headers[] = 'Dev'; } $errors = array(); foreach ($data as $name => $status) { if ($style->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE && !$status['stableStatus'] && (!$showTaggedDev || !$status['devStatus'])) { continue; } $row = array($status['name'], $this->tag($status['localVersion'], $status['localStatus']), $this->tag($status['stableVersion'], $status['stableStatus'])); if ($showTaggedDev) { $row[] = $this->tag($status['devVersion'], $status['devStatus']); } $rows[] = $row; } if (count($errors)) { $style->error(implode(PHP_EOL, $errors)); } if (count($rows)) { $style->table($headers, $rows); } else { $style->success('No outdated packages found.'); } }
/** * {@inheritdoc */ public function add_error_message($error_title, $error_description = false) { $this->io->newLine(); $message = $this->translate_message($error_title, $error_description); $this->io->error($message['title'] . "\n" . $message['description']); if ($this->progress_bar !== null) { $this->io->newLine(2); $this->progress_bar->display(); } }
/** * {@inheritdoc */ public function add_error_message($error_title, $error_description = false) { $this->io->newLine(); if (strpos($error_title, '<br />') !== false) { $error_title = strip_tags(str_replace('<br />', "\n", $error_title)); } $message = $this->translate_message($error_title, $error_description); $message_string = $message['title'] . (!empty($message['description']) ? "\n" . $message['description'] : ''); $this->io->error($message_string); if ($this->progress_bar !== null) { $this->io->newLine(2); $this->progress_bar->display(); } }
/** * Display command error note. * * @param OutputStyle $outputStyle * @return FetchCommand $this Fluent interface. */ protected function displayCommandError(OutputStyle $outputStyle) { $outputStyle->error('Unable to fetch data from source(s). See log for details.'); return $this; }