Closed
Description
The most obvious problem with this appears when you want to render multiple tables in one command; there is no way to reset the table!
An easy fix would be to reset the $rows and $headers properties as well in the cleanup() method, but IMO a different design pattern should be applied altogether. I think usage like this should be best:
use Symfony\Component\Console\Helper\Table\Table;
use Symfony\Component\Console\Helper\Table\TableLayout;
/* ... */
$table = new Table();
$table->setHeaders(array('header 1', 'header 2'));
$table->addRow(array('row 1', 'row 1'));
$table->addRow(array('row 2', 'row 2'));
$tableLayout = new TableLayout();
$tableLayout->setPaddingChar('*');
$tableLayout->setHorizontalBorderChar('=');
$tableHelper = $this->getHelperSet()->getHelper('table');
$helperHelper->render($table, $tableLayout);
And for the predefined layouts perhaps something like
$tableLayout = TableLayout::create(TableLayout::LAYOUT_BORDERLESS);
The second argument to the render method would default to the line above.
The same should apply to the progressHelper although the problem is not so obvious there.