Permalink
Browse files

Merge pull request #1073 from Pawka/f-searchfix

Fatal on: ./composer.phar search something
  • Loading branch information...
2 parents 0d3f7fc + bbac638 commit 509b8b9853b672dd8b39fe15a3b4f6c88c809e93 @Seldaek Seldaek committed Sep 7, 2012
@@ -27,7 +27,7 @@
class SearchCommand extends Command
{
protected $matches;
- protected $lowMatches;
+ protected $lowMatches = array();
protected $tokens;
protected $output;
@@ -118,7 +118,7 @@ public function addPackage(PackageInterface $package)
public function filterPackages($callback, $class = 'Composer\Package\Package')
{
foreach ($this->getPackages() as $package) {
- if (false === $callback($package)) {
+ if (false === call_user_func($callback, $package)) {
return false;
}
}
@@ -135,11 +135,11 @@ public function filterPackages($callback, $class = 'Composer\Package\Package')
}
foreach ($this->rawData as $package) {
- if (false === $callback($package = $this->loader->load($package, $class))) {
+ if (false === call_user_func($callback, $package = $this->loader->load($package, $class))) {
return false;
}
if ($package->getAlias()) {
- if (false === $callback($this->createAliasPackage($package))) {
+ if (false === call_user_func($callback, $this->createAliasPackage($package))) {
return false;
}
}

0 comments on commit 509b8b9

Please sign in to comment.