From e672628565dd9e3d4632f784921680ab9f4c0759 Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Sun, 5 Mar 2017 21:27:46 +0100 Subject: [PATCH] Separate package type from view representation --- src/Composer/Command/ShowCommand.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 226ca8dd7..ea05cb53e 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -234,14 +234,14 @@ EOT foreach ($repos as $repo) { if ($repo === $platformRepo) { - $type = 'platform:'; + $type = 'platform'; } elseif ( $repo === $installedRepo || ($installedRepo instanceof CompositeRepository && in_array($repo, $installedRepo->getRepositories(), true)) ) { - $type = 'installed:'; + $type = 'installed'; } else { - $type = 'available:'; + $type = 'available'; } if ($repo instanceof ComposerRepository && $repo->hasProviders()) { foreach ($repo->getProviderNames() as $name) { @@ -270,7 +270,7 @@ EOT $showMinorOnly = $input->getOption('minor-only'); $indent = $showAllTypes ? ' ' : ''; $latestPackages = array(); - foreach (array('platform:' => true, 'available:' => false, 'installed:' => true) as $type => $showVersion) { + foreach (array('platform' => true, 'available' => false, 'installed' => true) as $type => $showVersion) { if (isset($packages[$type])) { ksort($packages[$type]); @@ -320,7 +320,11 @@ EOT $hasOutdatedPackages = false; if ($showAllTypes) { - $io->write($type); + if ('available' === $type) { + $io->write('' . $type . ':'); + } else { + $io->write('' . $type . ':'); + } } foreach ($packages[$type] as $package) { if (is_object($package)) {