Skip to content

Commit

Permalink
abstain from registering incomplete services
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Apr 7, 2019
1 parent 907dafe commit d0aa22d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -25,6 +25,7 @@
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;

/**
* DoctrineExtension is an extension for the Doctrine DBAL and ORM library.
Expand Down Expand Up @@ -798,6 +799,10 @@ protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $c
*/
private function loadPropertyInfoExtractor($entityManagerName, ContainerBuilder $container)
{
if (! interface_exists(PropertyInfoExtractorInterface::class)) {
return;
}

$propertyExtractorDefinition = $container->register(sprintf('doctrine.orm.%s_entity_manager.property_info_extractor', $entityManagerName), DoctrineExtractor::class);
if (property_exists(DoctrineExtractor::class, 'entityManager')) {
$argumentId = sprintf('doctrine.orm.%s_entity_manager', $entityManagerName);
Expand Down

0 comments on commit d0aa22d

Please sign in to comment.