1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 00:53:06 +00:00

Update init and depends commands to use the new filterPackages method

This commit is contained in:
Jordi Boggiano 2012-08-23 20:05:16 +02:00
parent 012798b179
commit c31d588b7d
2 changed files with 27 additions and 59 deletions

View file

@ -267,13 +267,12 @@ EOT
}
$token = strtolower($name);
foreach ($this->repos->getPackages() as $package) {
if (false === ($pos = strpos($package->getName(), $token))) {
continue;
}
$packages[] = $package;
}
$this->repos->filterPackages(function ($package) use ($token, &$packages) {
if (false !== strpos($package->getName(), $token)) {
$packages[] = $package;
}
});
return $packages;
}