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