protected function getOutput(CliOutputInterface $output, $format) { switch ($format) { case 'csv': return new CsvOutput($output); break; case 'full': return new FullOutput($output); break; default: throw new \RuntimeException(sprintf("Unknown output format '%s'.", $format)); } }