Ver código fonte

Only pass remotefilesystem when needed, fixes #4779

Jordi Boggiano 9 anos atrás
pai
commit
974fb4ac66
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      src/Composer/Repository/RepositoryManager.php

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