From 80be9a2c981373c77af2c37edfbb546816d3413f Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 15 Mar 2016 20:46:00 +0100 Subject: [PATCH] Add deprecated notice to show command --- src/Composer/Command/ShowCommand.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 1c2a3e9ea..4cc611963 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -294,6 +294,22 @@ EOT $path = strtok(realpath($composer->getInstallationManager()->getInstallPath($package)), "\r\n"); $io->write(' ' . $path, false); } + + if ($showLatest && $package->isAbandoned()) { + $replacement = (is_string($package->getReplacementPackage())) + ? 'Use ' . $package->getReplacementPackage() . ' instead' + : 'No replacement was suggested'; + + $io->write(''); + $io->write( + sprintf( + "Package %s is abandoned, you should avoid using it. %s.", + $package->getPrettyName(), + $replacement + ), + false + ); + } } else { $io->write($indent . $package, false); }