Skip to content

Commit

Permalink
[TASK] Make some Symfony/Console helper methods optional
Browse files Browse the repository at this point in the history
until the situation is clear, why not all Symfony/Console/Helper/TableStye
methods exists ¯\_(ツ)_/¯
  • Loading branch information
josefglatz committed Nov 9, 2020
1 parent 7432f65 commit 01ec8f4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/DiffPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public function onPostUpdate(Event $arg)

$table = new Table($output);
$table->setStyle('compact');
if (method_exists($table, 'setVerticalBorderChars')) {
$table->getStyle()->setVerticalBorderChars('');
}
$table->getStyle()->setCellRowContentFormat('%s ');

// deleted packages
Expand Down Expand Up @@ -211,6 +214,9 @@ protected function writeLibraryList($packages)
$output = new StreamOutput($fp);
$table = new Table($output);
$table->setStyle('compact');
if (method_exists($table, 'setVerticalBorderChars')) {
$table->getStyle()->setVerticalBorderChars('');
}
$table->getStyle()->setCellRowContentFormat('%s ');
$table->setHeaders(array('Package Name', 'Version', 'License', 'Type'));
foreach ($packages as $name => $p) {
Expand All @@ -221,7 +227,9 @@ protected function writeLibraryList($packages)
$p['type'],
));
}
$table->setColumnWidths([ 50, 25, 20, 15 ]);
if (method_exists($table, 'setColumnWidths')) {
$table->setColumnWidths([ 50, 25, 20, 15 ]);
}
$table->render();

unset($table);
Expand Down

0 comments on commit 01ec8f4

Please sign in to comment.