Fixed the tests
array_filter preserves the keys even when filtering an array indexed numerically.pull/212/head
parent
38a5f04ea0
commit
bca786d5c3
|
@ -48,10 +48,15 @@ class ArrayRepository implements RepositoryInterface
|
||||||
{
|
{
|
||||||
// normalize name
|
// normalize name
|
||||||
$name = strtolower($name);
|
$name = strtolower($name);
|
||||||
|
$packages = array();
|
||||||
|
|
||||||
return array_filter($this->getPackages(), function (PackageInterface $package) use ($name) {
|
foreach ($this->getPackages() as $package) {
|
||||||
return $package->getName() === $name;
|
if ($package->getName() === $name) {
|
||||||
});
|
$packages[] = $package;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue