Skip to content

Commit

Permalink
Use early exit to keep phpcs happy
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Dec 22, 2018
1 parent 93810ae commit 7f7d10d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -368,10 +368,12 @@ protected function ormLoad(array $config, ContainerBuilder $container)
->addTag(ServiceRepositoryCompilerPass::REPOSITORY_SERVICE_TAG);

// If the Messenger component is installed and the doctrine transaction middleware is available, wire it:
if (interface_exists(MessageBusInterface::class) && class_exists(DoctrineTransactionMiddleware::class)) {
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('messenger.xml');
if (! interface_exists(MessageBusInterface::class) || ! class_exists(DoctrineTransactionMiddleware::class)) {
return;
}

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

/**
Expand Down

0 comments on commit 7f7d10d

Please sign in to comment.