From 0b78fdffa42a1b471d551051aa4b08298de62123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bj=C3=B8rnskov?= Date: Wed, 1 Aug 2012 11:32:18 +0200 Subject: [PATCH] Only call registerCommand on bundles that is an instance of Bundle Fixes GH-5133 --- src/Symfony/Bundle/FrameworkBundle/Console/Application.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php index 4369623d0f..ca74d63a00 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php @@ -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); + } } } }