Only call registerCommand on bundles that is an instance of Bundle

Fixes GH-5133
This commit is contained in:
Henrik Bjørnskov 2012-08-01 11:32:18 +02:00
parent 1da896dc7e
commit 0b78fdffa4

View File

@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\Bundle;
/**
* Application.
@ -78,8 +79,11 @@ class Application extends BaseApplication
protected function registerCommands()
{
$this->kernel->boot();
foreach ($this->kernel->getBundles() as $bundle) {
$bundle->registerCommands($this);
if ($bundle instanceof Bundle) {
$bundle->registerCommands($this);
}
}
}
}