From 086c9d5c5655b6f4e08ae62f8ba56cf43adac512 Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Sun, 5 Mar 2017 22:33:00 +0100 Subject: [PATCH] Separate package warning from view representation --- src/Composer/Command/ShowCommand.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 151103b2e..5a6f99fd4 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -375,16 +375,13 @@ EOT $replacement = (is_string($latestPackage->getReplacementPackage())) ? 'Use ' . $latestPackage->getReplacementPackage() . ' instead' : 'No replacement was suggested'; - - $io->writeError(''); - $io->writeError( - sprintf( - "Package %s is abandoned, you should avoid using it. %s.", - $package->getPrettyName(), - $replacement - ), - false + $packageWarning = sprintf( + 'Package %s is abandoned, you should avoid using it. %s.', + $package->getPrettyName(), + $replacement ); + $io->writeError(''); + $io->writeError('' . $packageWarning . '', false); } } else { $io->write($indent . $package, false);