From ab945a6ec1899d5f5f5f844d39d5e921ddcebccd Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 19 Feb 2019 11:11:35 +0100 Subject: [PATCH] Clean up RepositoryInterface, fixes #5464 --- src/Composer/Repository/RepositoryInterface.php | 3 ++- src/Composer/Repository/RepositoryManager.php | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Composer/Repository/RepositoryInterface.php b/src/Composer/Repository/RepositoryInterface.php index 567455163..e5f2c5159 100644 --- a/src/Composer/Repository/RepositoryInterface.php +++ b/src/Composer/Repository/RepositoryInterface.php @@ -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); } diff --git a/src/Composer/Repository/RepositoryManager.php b/src/Composer/Repository/RepositoryManager.php index c3ce0c24a..2dca57099 100644 --- a/src/Composer/Repository/RepositoryManager.php +++ b/src/Composer/Repository/RepositoryManager.php @@ -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); } /**