1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00

Moved duplicated table render code to a new method in BaseCommand

This commit is contained in:
Simon Berger 2020-09-03 15:56:04 +02:00
parent 86ff43d8b9
commit 687f886d56
4 changed files with 18 additions and 36 deletions

View file

@ -15,7 +15,6 @@ namespace Composer\Command;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@ -169,18 +168,7 @@ EOT
$status,
);
}
$table = array_merge($rows, $table);
// Render table
$renderer = new Table($output);
$renderer->setStyle('compact');
$rendererStyle = $renderer->getStyle();
if (method_exists($rendererStyle, 'setVerticalBorderChars')) {
$rendererStyle->setVerticalBorderChars('');
} else {
$rendererStyle->setVerticalBorderChar('');
}
$rendererStyle->setCellRowContentFormat('%s ');
$renderer->setRows($table)->render();
$this->renderTable($rows, $output);
}
}