1
0
Fork 0

Clean up RepositoryInterface, fixes #5464

pull/7906/head^2
Jordi Boggiano 2019-02-19 11:11:35 +01:00
parent 6c782599f1
commit ab945a6ec1
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 3 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);
}
/**