Skip to content

Commit

Permalink
should check against all packages, not only the first one
Browse files Browse the repository at this point in the history
  • Loading branch information
alcohol committed Oct 8, 2019
1 parent 6d23cec commit 6e50c07
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/PackageSelection/PackageSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,19 +789,23 @@ function ($repository) use ($url) {
*/
private function filterPackages(array $repositories): array
{
$package = $this->packagesFilter;
$packages = $this->packagesFilter;

return array_filter($repositories, function ($repository) use ($package) {
if (!($repository instanceof ConfigurableRepositoryInterface)) {
return false;
}
$config = $repository->getRepoConfig();
return array_filter(
$repositories,
function ($repository) use ($packages) {
if (!($repository instanceof ConfigurableRepositoryInterface)) {
return false;
}

if (!isset($config['name']) || $config['name'] !== $package[0]) {
return false;
}
$config = $repository->getRepoConfig();

return true;
});
if (!isset($config['name']) || !in_array($config['name'], $packages)) {
return false;
}

return true;
}
);
}
}

0 comments on commit 6e50c07

Please sign in to comment.