Эх сурвалжийг харах

Fix behavior broken by #665

Jordi Boggiano 13 жил өмнө
parent
commit
b566ba77ac

+ 6 - 1
src/Composer/Command/Command.php

@@ -46,7 +46,12 @@ abstract class Command extends BaseCommand
             $application = $this->getApplication();
             if ($application instanceof Application) {
                 /* @var $application    Application */
-                $this->composer = $application->getComposer();
+                $this->composer = $application->getComposer($required);
+            } elseif ($required) {
+                throw new \RuntimeException(
+                    'Could not create a Composer\Composer instance, you must inject '.
+                    'one if this command is not used with a Composer\Console\Application instance'
+                );
             }
         }
 

+ 1 - 1
src/Composer/Composer.php

@@ -130,7 +130,7 @@ class Composer
     }
 
     /**
-     * @return  Doenloader\DownloadManager
+     * @return  Downloader\DownloadManager
      */
     public function getDownloadManager()
     {

+ 1 - 1
src/Composer/Console/Application.php

@@ -41,7 +41,7 @@ class Application extends BaseApplication
     protected $composer;
 
     /**
-     * @var ConsoleIO
+     * @var IOInterface
      */
     protected $io;