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 e4ed35f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -25,7 +25,7 @@
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\PropertyInfo\PropertyInitializableExtractorInterface;
use Symfony\Contracts\Service\ResetInterface;

/**
* DoctrineExtension is an extension for the Doctrine DBAL and ORM library.
Expand Down Expand Up @@ -800,7 +800,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 (is_a(DoctrineType::class, ResetInterface::class, true)) {
$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 e4ed35f

Please sign in to comment.