1
0
Fork 0

Remove deprecated TableHelper and update table style

pull/3593/head
SofHad 2014-12-26 01:43:36 +01:00
parent 4569f528f6
commit dc9429c82a
1 changed files with 11 additions and 4 deletions

View File

@ -18,7 +18,8 @@ use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Package\PackageInterface;
use Composer\Repository\RepositoryInterface;
use Symfony\Component\Console\Helper\TableHelper;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@ -73,9 +74,15 @@ EOT
$output->writeln('Licenses: <comment>'.(implode(', ', $root->getLicense()) ?: 'none').'</comment>');
$output->writeln('Dependencies:');
$table = $this->getHelperSet()->get('table');
$table->setLayout(TableHelper::LAYOUT_BORDERLESS);
$table->setHorizontalBorderChar('');
$table = new Table($output);
$style = new TableStyle();
$style
->setHorizontalBorderChar('<fg=magenta>-</>')
->setVerticalBorderChar('<fg=magenta>|</>')
->setCrossingChar(' ')
;
$table->setStyle($style);
$table->setHeaders(array('Name', 'Version', 'License'));
foreach ($packages as $package) {
$table->addRow(array(
$package->getPrettyName(),