/** * @param OutputInterface $outputInterface * @param array $rows * @param string $format */ public function renderByFormat(OutputInterface $outputInterface, array $rows, $format = '') { $rendererFactory = new RendererFactory(); $renderer = $rendererFactory->create($format); if ($renderer && $renderer instanceof RendererInterface) { foreach ($rows as &$row) { $row = array_combine($this->headers, $row); } $renderer->render($outputInterface, $rows); } else { $this->setRows($rows); $this->render($outputInterface); } }