From a8ec134c2c34482bedf08c6d022cbbc5ca3fa7bc Mon Sep 17 00:00:00 2001 From: David Zuelke Date: Sun, 6 Apr 2014 00:07:20 +0200 Subject: [PATCH] Only print suggestions in dev mode There is no need to clutter the screen/logs/whatever with suggestions in production installs. If someone didn't care about them in dev mode, they certainly won't in production :) --- src/Composer/Installer.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 839fc45e4..cfc08c23d 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -223,16 +223,18 @@ class Installer } $this->installationManager->notifyInstalls(); - // output suggestions - foreach ($this->suggestedPackages as $suggestion) { - $target = $suggestion['target']; - foreach ($installedRepo->getPackages() as $package) { - if (in_array($target, $package->getNames())) { - continue 2; + // output suggestions if we're in dev mode + if (!$this->devMode) { + foreach ($this->suggestedPackages as $suggestion) { + $target = $suggestion['target']; + foreach ($installedRepo->getPackages() as $package) { + if (in_array($target, $package->getNames())) { + continue 2; + } } - } - $this->io->write($suggestion['source'].' suggests installing '.$suggestion['target'].' ('.$suggestion['reason'].')'); + $this->io->write($suggestion['source'].' suggests installing '.$suggestion['target'].' ('.$suggestion['reason'].')'); + } } if (!$this->dryRun) {