From 63eb178297922f43af083d88250b90758eaf2ac0 Mon Sep 17 00:00:00 2001 From: Bingqing Wang Date: Thu, 9 Apr 2020 13:03:42 +0800 Subject: [PATCH 1/2] compatible with symfony/console 5.0.0 getVerticalBorderChars() method --- src/Composer/Command/BaseDependencyCommand.php | 6 +++++- src/Composer/Command/CheckPlatformReqsCommand.php | 6 +++++- src/Composer/Command/LicensesCommand.php | 6 +++++- src/Composer/Command/RunScriptCommand.php | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/BaseDependencyCommand.php b/src/Composer/Command/BaseDependencyCommand.php index 78fe0551e..34de286f8 100644 --- a/src/Composer/Command/BaseDependencyCommand.php +++ b/src/Composer/Command/BaseDependencyCommand.php @@ -184,7 +184,11 @@ class BaseDependencyCommand extends BaseCommand $renderer = new Table($output); $renderer->setStyle('compact'); $rendererStyle = $renderer->getStyle(); - $rendererStyle->setVerticalBorderChar(''); + if (method_exists($rendererStyle, 'setVerticalBorderChars')) { + $rendererStyle->setVerticalBorderChars(''); + } else { + $rendererStyle->setVerticalBorderChar(''); + } $rendererStyle->setCellRowContentFormat('%s '); $renderer->setRows($table)->render(); } diff --git a/src/Composer/Command/CheckPlatformReqsCommand.php b/src/Composer/Command/CheckPlatformReqsCommand.php index 195a2c490..622882ceb 100644 --- a/src/Composer/Command/CheckPlatformReqsCommand.php +++ b/src/Composer/Command/CheckPlatformReqsCommand.php @@ -155,7 +155,11 @@ EOT $renderer = new Table($output); $renderer->setStyle('compact'); $rendererStyle = $renderer->getStyle(); - $rendererStyle->setVerticalBorderChar(''); + if (method_exists($rendererStyle, 'setVerticalBorderChars')) { + $rendererStyle->setVerticalBorderChars(''); + } else { + $rendererStyle->setVerticalBorderChar(''); + } $rendererStyle->setCellRowContentFormat('%s '); $renderer->setRows($table)->render(); } diff --git a/src/Composer/Command/LicensesCommand.php b/src/Composer/Command/LicensesCommand.php index 7537945e9..c30a53c9b 100644 --- a/src/Composer/Command/LicensesCommand.php +++ b/src/Composer/Command/LicensesCommand.php @@ -77,7 +77,11 @@ EOT $table = new Table($output); $table->setStyle('compact'); $tableStyle = $table->getStyle(); - $tableStyle->setVerticalBorderChar(''); + if (method_exists($rendererStyle, 'setVerticalBorderChars')) { + $rendererStyle->setVerticalBorderChars(''); + } else { + $rendererStyle->setVerticalBorderChar(''); + } $tableStyle->setCellRowContentFormat('%s '); $table->setHeaders(array('Name', 'Version', 'License')); foreach ($packages as $package) { diff --git a/src/Composer/Command/RunScriptCommand.php b/src/Composer/Command/RunScriptCommand.php index a110cc3d6..1d1b6be76 100644 --- a/src/Composer/Command/RunScriptCommand.php +++ b/src/Composer/Command/RunScriptCommand.php @@ -133,7 +133,11 @@ EOT $renderer = new Table($output); $renderer->setStyle('compact'); $rendererStyle = $renderer->getStyle(); - $rendererStyle->setVerticalBorderChar(''); + if (method_exists($rendererStyle, 'setVerticalBorderChars')) { + $rendererStyle->setVerticalBorderChars(''); + } else { + $rendererStyle->setVerticalBorderChar(''); + } $rendererStyle->setCellRowContentFormat('%s '); $renderer->setRows($table)->render(); From 46db638678ea9222307dec3bae660434a7cec527 Mon Sep 17 00:00:00 2001 From: Bingqing Wang Date: Thu, 9 Apr 2020 13:21:25 +0800 Subject: [PATCH 2/2] fix typo --- src/Composer/Command/LicensesCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/LicensesCommand.php b/src/Composer/Command/LicensesCommand.php index c30a53c9b..85cb64a7f 100644 --- a/src/Composer/Command/LicensesCommand.php +++ b/src/Composer/Command/LicensesCommand.php @@ -77,10 +77,10 @@ EOT $table = new Table($output); $table->setStyle('compact'); $tableStyle = $table->getStyle(); - if (method_exists($rendererStyle, 'setVerticalBorderChars')) { - $rendererStyle->setVerticalBorderChars(''); + if (method_exists($tableStyle, 'setVerticalBorderChars')) { + $tableStyle->setVerticalBorderChars(''); } else { - $rendererStyle->setVerticalBorderChar(''); + $tableStyle->setVerticalBorderChar(''); } $tableStyle->setCellRowContentFormat('%s '); $table->setHeaders(array('Name', 'Version', 'License'));