diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index 03550836cf..e9932d1f87 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -17,7 +17,6 @@ use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\SymfonyQuestionHelper; use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; @@ -218,21 +217,13 @@ class SymfonyStyle extends OutputStyle */ public function table(array $headers, array $rows) { - array_walk_recursive($headers, function (&$value) { - if ($value instanceof TableCell) { - $value = new TableCell(sprintf('%s', $value), array( - 'colspan' => $value->getColspan(), - 'rowspan' => $value->getRowspan(), - )); - } else { - $value = sprintf('%s', $value); - } - }); + $style = clone Table::getStyleDefinition('symfony-style-guide'); + $style->setCellHeaderFormat('%s'); $table = new Table($this); $table->setHeaders($headers); $table->setRows($rows); - $table->setStyle('symfony-style-guide'); + $table->setStyle($style); $table->render(); $this->newLine();