Skip to content

Commit

Permalink
Merge branch '1.12.x'
Browse files Browse the repository at this point in the history
* 1.12.x:
  Load messenger services independently from ORM layer
  • Loading branch information
alcaeus committed Oct 14, 2019
2 parents 357a477 + de7f559 commit 15967f6
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 @@ -48,6 +48,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 @@ -58,10 +60,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 @@ -329,6 +327,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 @@ -387,8 +389,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 @@ -664,12 +664,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 15967f6

Please sign in to comment.