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:
parent
012798b179
commit
c31d588b7d
2 changed files with 27 additions and 59 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue