From 7f7d10d6e36def0361347c7864b565ce93a489fc Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Sat, 22 Dec 2018 14:49:24 +0100 Subject: [PATCH] Use early exit to keep phpcs happy --- DependencyInjection/DoctrineExtension.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/DoctrineExtension.php b/DependencyInjection/DoctrineExtension.php index a973f6d57..920aebaf1 100644 --- a/DependencyInjection/DoctrineExtension.php +++ b/DependencyInjection/DoctrineExtension.php @@ -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'); } /**