1
0
Fork 0

Fix behavior broken by #665

pull/824/merge
Jordi Boggiano 2012-06-23 11:47:53 +02:00
parent de449aa144
commit b566ba77ac
3 changed files with 8 additions and 3 deletions

View File

@ -46,7 +46,12 @@ abstract class Command extends BaseCommand
$application = $this->getApplication(); $application = $this->getApplication();
if ($application instanceof Application) { if ($application instanceof Application) {
/* @var $application 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'
);
} }
} }

View File

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

View File

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