From 1fdb7aef56ec6d380bd23da24de83a7ef8a7f97a Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Mon, 16 Jan 2012 12:52:17 +0100 Subject: [PATCH] Changed the ShowCommand to use the new method --- src/Composer/Command/ShowCommand.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 224053c8e..334cd8997 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -85,11 +85,9 @@ EOT $composer->getRepositoryManager()->getRepositories() ); foreach ($repos as $repository) { - foreach ($repository->getPackages() as $package) { - if ($package->getName() === $input->getArgument('package')) { - if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion(), '>=')) { - $highestVersion = $package; - } + foreach ($repository->findPackagesByName($input->getArgument('package')) as $package) { + if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion(), '>=')) { + $highestVersion = $package; } } } @@ -135,10 +133,8 @@ EOT $versions = array(); foreach ($composer->getRepositoryManager()->getRepositories() as $repository) { - foreach ($repository->getPackages() as $version) { - if ($version->getName() === $package->getName()) { - $versions[] = $version->getPrettyVersion(); - } + foreach ($repository->findPackagesByName($package->getName()) as $version) { + $versions[] = $version->getPrettyVersion(); } }