Преглед изворни кода

Use factory name instead of generator.

Beau Simensen пре 13 година
родитељ
комит
1e9cb6bac8

+ 4 - 4
src/Composer/Repository/Vcs/GitHubDriver.php

@@ -33,15 +33,15 @@ class GitHubDriver extends VcsDriver
      * @param string $url
      * @param IOInterface $io
      * @param ProcessExecutor $process
-     * @param callable $remoteFilesystemGenerator
+     * @param callable $remoteFilesystemFactory
      */
-    public function __construct($url, IOInterface $io, ProcessExecutor $process = null, $remoteFilesystemGenerator = null)
+    public function __construct($url, IOInterface $io, ProcessExecutor $process = null, $remoteFilesystemFactory = null)
     {
         preg_match('#^(?:https?|git)://github\.com/([^/]+)/(.+?)(?:\.git)?$#', $url, $match);
         $this->owner = $match[1];
         $this->repository = $match[2];
 
-        parent::__construct($url, $io, $process, $remoteFilesystemGenerator);
+        parent::__construct($url, $io, $process, $remoteFilesystemFactory);
     }
 
     /**
@@ -216,7 +216,7 @@ class GitHubDriver extends VcsDriver
                                 $this->generateSshUrl(),
                                 $this->io,
                                 $this->process,
-                                $this->remoteFilesystemGenerator
+                                $this->remoteFilesystemFactory
                             );
                             $this->gitDriver->initialize();
                             return;

+ 5 - 5
src/Composer/Repository/Vcs/VcsDriver.php

@@ -27,7 +27,7 @@ abstract class VcsDriver implements VcsDriverInterface
     protected $url;
     protected $io;
     protected $process;
-    protected $remoteFilesystemGenerator;
+    protected $remoteFilesystemFactory;
 
     /**
      * Constructor.
@@ -35,14 +35,14 @@ abstract class VcsDriver implements VcsDriverInterface
      * @param string      $url The URL
      * @param IOInterface $io  The IO instance
      * @param ProcessExecutor $process  Process instance, injectable for mocking
-     * @param callable $remoteFilesystemGenerator Generates Remote Filesystem, injectable for mocking
+     * @param callable $remoteFilesystemFactory Remote Filesystem factory, injectable for mocking
      */
-    public function __construct($url, IOInterface $io, ProcessExecutor $process = null, $remoteFilesystemGenerator = null)
+    public function __construct($url, IOInterface $io, ProcessExecutor $process = null, $remoteFilesystemFactory = null)
     {
         $this->url = $url;
         $this->io = $io;
         $this->process = $process ?: new ProcessExecutor;
-        $this->remoteFilesystemGenerator = $remoteFilesystemGenerator ?: function() use ($io) {
+        $this->remoteFilesystemFactory = $remoteFilesystemFactory ?: function() use ($io) {
             return new RemoteFilesystem($io);
         };
     }
@@ -85,7 +85,7 @@ abstract class VcsDriver implements VcsDriverInterface
      */
     protected function getContents($url)
     {
-        $rfs = call_user_func($this->remoteFilesystemGenerator);
+        $rfs = call_user_func($this->remoteFilesystemFactory);
         return $rfs->getContents($this->url, $url, false);
     }