Clean up RepositoryInterface, fixes #5464

main
Jordi Boggiano 5 years ago
parent 6c782599f1
commit ab945a6ec1
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -78,8 +78,9 @@ interface RepositoryInterface extends \Countable
*
* @param string $query search query
* @param int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only
* @param string $type The type of package to search for. Defaults to all types of packages
*
* @return array[] an array of array('name' => '...', 'description' => '...')
*/
public function search($query, $mode = 0);
public function search($query, $mode = 0, $type = null);
}

@ -125,13 +125,7 @@ class RepositoryManager
$class = $this->repositoryClasses[$type];
$reflMethod = new \ReflectionMethod($class, '__construct');
$params = $reflMethod->getParameters();
if (isset($params[3]) && $params[3]->getClass() && $params[3]->getClass()->getName() === 'Composer\Util\HttpDownloader') {
return new $class($config, $this->io, $this->config, $this->httpDownloader, $this->eventDispatcher);
}
return new $class($config, $this->io, $this->config, $this->eventDispatcher);
return new $class($config, $this->io, $this->config, $this->httpDownloader, $this->eventDispatcher);
}
/**

Loading…
Cancel
Save