8000 Merge branch '2.8' into 3.0 · symfony/console@a7abb71 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7abb71

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For fixed test [Console] Decouple SymfonyStyle from TableCell
2 parents 853f470 + c392a6e commit a7abb71

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Style/SymfonyStyle.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\Console\Helper\ProgressBar;
1919
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
2020
use Symfony\Component\Console\Helper\Table;
21-
use Symfony\Component\Console\Helper\TableCell;
2221
use Symfony\Component\Console\Input\InputInterface;
2322
use Symfony\Component\Console\Output\BufferedOutput;
2423
use Symfony\Component\Console\Output\OutputInterface;
@@ -185,21 +184,13 @@ public function caution($message)
185184
*/
186185
public function table(array $headers, array $rows)
187186
{
188-
array_walk_recursive($headers, function (&$value) {
189-
if ($value instanceof TableCell) {
190-
$value = new TableCell(sprintf('<info>%s</>', $value), array(
191-
'colspan' => $value->getColspan(),
192-
'rowspan' => $value->getRowspan(),
193-
));
194-
} else {
195-
$value = sprintf('<info>%s</>', $value);
196-
}
197-
});
187+
$style = clone Table::getStyleDefinition('symfony-style-guide');
188+
$style->setCellHeaderFormat('<info>%s</info>');
198189

199190
$table = new Table($this);
200191
$table->setHeaders($headers);
201192
$table->setRows($rows);
202-
$table->setStyle('symfony-style-guide');
193+
$table->setStyle($style);
203194

204195
$table->render();
205196
$this->newLine();

0 commit comments

Comments
 (0)
0