/** * {@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.'); } }
/** * Display command begin note. * * @param InputInterface $input Console input. * @param OutputStyle $outputStyle Console style. * @return FetchCommand $this Fluent interface. */ protected function displayCommandBegin(InputInterface $input, OutputStyle $outputStyle) { $outputStyle->title('Exchange rates:'); $outputStyle->text(sprintf('Fetching from %s for date %s....', $input->getOption('source') ? sprintf('"%s"', implode('", "', $input->getOption('source'))) : 'all sources', $input->getOption('date')->format('Y-m-d'))); return $this; }