1
0
Fork 0

Changed the ShowCommand to use the new method

pull/208/head
Christophe Coevoet 2012-01-16 12:52:17 +01:00
parent fc17e26bc3
commit 1fdb7aef56
1 changed files with 5 additions and 9 deletions

View File

@ -85,14 +85,12 @@ EOT
$composer->getRepositoryManager()->getRepositories() $composer->getRepositoryManager()->getRepositories()
); );
foreach ($repos as $repository) { foreach ($repos as $repository) {
foreach ($repository->getPackages() as $package) { foreach ($repository->findPackagesByName($input->getArgument('package')) as $package) {
if ($package->getName() === $input->getArgument('package')) {
if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion(), '>=')) { if (null === $highestVersion || version_compare($package->getVersion(), $highestVersion->getVersion(), '>=')) {
$highestVersion = $package; $highestVersion = $package;
} }
} }
} }
}
return $highestVersion; return $highestVersion;
} }
@ -135,12 +133,10 @@ EOT
$versions = array(); $versions = array();
foreach ($composer->getRepositoryManager()->getRepositories() as $repository) { foreach ($composer->getRepositoryManager()->getRepositories() as $repository) {
foreach ($repository->getPackages() as $version) { foreach ($repository->findPackagesByName($package->getName()) as $version) {
if ($version->getName() === $package->getName()) {
$versions[] = $version->getPrettyVersion(); $versions[] = $version->getPrettyVersion();
} }
} }
}
$versions = join(', ', $versions); $versions = join(', ', $versions);