Skip to content

Commit

Permalink
Merge pull request #1028 from alcaeus/load-messenger-dbal
Browse files Browse the repository at this point in the history
Load messenger services independently from ORM layer
  • Loading branch information
alcaeus authored Oct 14, 2019
2 parents 4def364 + 80dace0 commit de7f559
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
12 changes: 6 additions & 6 deletions DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function load(array $configs, ContainerBuilder $container)

if (! empty($config['dbal'])) {
$this->dbalLoad($config['dbal'], $container);

$this->loadMessengerServices($container);
}

if (empty($config['orm'])) {
Expand All @@ -70,10 +72,6 @@ public function load(array $configs, ContainerBuilder $container)
throw new LogicException('Configuring the ORM layer requires to configure the DBAL layer as well.');
}

if (! class_exists(Version::class)) {
throw new LogicException('To configure the ORM layer, you must first install the doctrine/orm package.');
}

$this->ormLoad($config['orm'], $container);
}

Expand Down Expand Up @@ -341,6 +339,10 @@ protected function getConnectionOptions($connection)
*/
protected function ormLoad(array $config, ContainerBuilder $container)
{
if (! class_exists(Version::class)) {
throw new LogicException('To configure the ORM layer, you must first install the doctrine/orm package.');
}

$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('orm.xml');

Expand Down Expand Up @@ -399,8 +401,6 @@ protected function ormLoad(array $config, ContainerBuilder $container)

$container->registerForAutoconfiguration(ServiceEntityRepositoryInterface::class)
->addTag(ServiceRepositoryCompilerPass::REPOSITORY_SERVICE_TAG);

$this->loadMessengerServices($container);
}

/**
Expand Down
6 changes: 0 additions & 6 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,12 +663,6 @@ public function testMessengerIntegration()

$config = BundleConfigurationBuilder::createBuilder()
->addBaseConnection()
->addEntityManager([
'default_entity_manager' => 'default',
'entity_managers' => [
'default' => [],
],
])
->build();
$extension->load([$config], $container);

Expand Down

0 comments on commit de7f559

Please sign in to comment.