Skip to content

Commit

Permalink
Detect doctrine bridge version
Browse files Browse the repository at this point in the history
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
  • Loading branch information
greg0ire committed Feb 4, 2019
1 parent dc8feee commit 98ab626
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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 (property_exists(DoctrineExtractor::class, 'entityManager')) {
$argumentId = sprintf('doctrine.orm.%s_entity_manager', $entityManagerName);
} else {
$argumentId = sprintf('doctrine.orm.%s_entity_manager.metadata_factory', $entityManagerName);
Expand Down

0 comments on commit 98ab626

Please sign in to comment.