From 165697f26932eec43c7c09f44d564c25b346e876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 4 Feb 2019 09:03:02 +0100 Subject: [PATCH] Detect doctrine bridge version Although it is in the PropertyInfo sub namespace, the DoctrineExtractor class is in the doctrine bridge, which means we should detect the doctrine bridge version and not the PropertyInfo component version. Fixes #883, Closes #884 --- DependencyInjection/DoctrineExtension.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DependencyInjection/DoctrineExtension.php b/DependencyInjection/DoctrineExtension.php index 828876cf2..315e4ba71 100644 --- a/DependencyInjection/DoctrineExtension.php +++ b/DependencyInjection/DoctrineExtension.php @@ -25,7 +25,6 @@ use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\Form\AbstractType; use Symfony\Component\Messenger\MessageBusInterface; -use Symfony\Component\PropertyInfo\PropertyInitializableExtractorInterface; /** * DoctrineExtension is an extension for the Doctrine DBAL and ORM library. @@ -800,7 +799,7 @@ protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $c private function loadPropertyInfoExtractor($entityManagerName, ContainerBuilder $container) { $propertyExtractorDefinition = $container->register(sprintf('doctrine.orm.%s_entity_manager.property_info_extractor', $entityManagerName), DoctrineExtractor::class); - if (interface_exists(PropertyInitializableExtractorInterface::class)) { + if ((new \ReflectionClass(DoctrineExtractor::class))->hasProperty('entityManager')) { $argumentId = sprintf('doctrine.orm.%s_entity_manager', $entityManagerName); } else { $argumentId = sprintf('doctrine.orm.%s_entity_manager.metadata_factory', $entityManagerName);