Skip to content

Commit

Permalink
Remove the registerCommands() methods (see #1126)
Browse files Browse the repository at this point in the history
Description
-----------

Symfony 4.4 no longer auto-registers commands, therefore we do not have to override the method anymore.

Commits
-------

c24b446 Remove the registerCommands() methods
  • Loading branch information
leofeyer committed Dec 23, 2019
1 parent 1aacab4 commit 385fc89
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
9 changes: 0 additions & 9 deletions core-bundle/src/ContaoCoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Contao\CoreBundle\Fragment\Reference\ContentElementReference;
use Contao\CoreBundle\Fragment\Reference\FrontendModuleReference;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand All @@ -50,14 +49,6 @@ public function getContainerExtension(): ContaoCoreExtension
return new ContaoCoreExtension();
}

/**
* {@inheritdoc}
*/
public function registerCommands(Application $application): void
{
// disable automatic command registration
}

/**
* {@inheritdoc}
*/
Expand Down
12 changes: 0 additions & 12 deletions core-bundle/tests/ContaoCoreBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,11 @@
use Contao\CoreBundle\DependencyInjection\Compiler\TranslationDataCollectorPass;
use Contao\CoreBundle\DependencyInjection\Security\ContaoLoginFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\FragmentRendererPass;

class ContaoCoreBundleTest extends TestCase
{
public function testDoesNotRegisterAnyCommands(): void
{
$application = new Application();
$commands = $application->all();

$bundle = new ContaoCoreBundle();
$bundle->registerCommands($application);

$this->assertSame($commands, $application->all());
}

public function testAddsTheCompilerPaths(): void
{
$passes = [
Expand Down
9 changes: 0 additions & 9 deletions manager-bundle/src/ContaoManagerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
namespace Contao\ManagerBundle;

use Contao\ManagerBundle\DependencyInjection\Compiler\ContaoManagerPass;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand All @@ -28,12 +27,4 @@ public function build(ContainerBuilder $container): void

$container->addCompilerPass(new ContaoManagerPass());
}

/**
* {@inheritdoc}
*/
public function registerCommands(Application $application): void
{
// disable automatic command registration
}
}

0 comments on commit 385fc89

Please sign in to comment.