From 974fb4ac66c427b87f3cfa29e1320cd97f182b9d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 16 Jan 2016 17:45:40 +0000 Subject: [PATCH] Only pass remotefilesystem when needed, fixes #4779 --- src/Composer/Repository/RepositoryManager.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/RepositoryManager.php b/src/Composer/Repository/RepositoryManager.php index 42520ebd4..c6d7a422d 100644 --- a/src/Composer/Repository/RepositoryManager.php +++ b/src/Composer/Repository/RepositoryManager.php @@ -105,7 +105,13 @@ class RepositoryManager $class = $this->repositoryClasses[$type]; - return new $class($config, $this->io, $this->config, $this->eventDispatcher, $this->rfs); + $reflMethod = new \ReflectionMethod($class, '__construct'); + $params = $reflMethod->getParameters(); + if (isset($params[4]) && $params[4]->getType()->__toString() === 'Composer\Util\RemoteFilesystem') { + return new $class($config, $this->io, $this->config, $this->eventDispatcher, $this->rfs); + } + + return new $class($config, $this->io, $this->config, $this->eventDispatcher); } /**