From 5c9bf1c43a157ce31dc763c69fd2ff1c5d8b37c7 Mon Sep 17 00:00:00 2001 From: "Issei.M" Date: Tue, 10 Oct 2017 13:38:18 +0900 Subject: [PATCH] Drop (implicitly) support Doctrine/ORM older (< 5.4) version --- DependencyInjection/Compiler/IntegrationPass.php | 6 ++++++ composer.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Compiler/IntegrationPass.php b/DependencyInjection/Compiler/IntegrationPass.php index d879e39..fd508db 100644 --- a/DependencyInjection/Compiler/IntegrationPass.php +++ b/DependencyInjection/Compiler/IntegrationPass.php @@ -47,6 +47,12 @@ private function integrateWithDoctrine(ContainerBuilder $container) return; } + // Can't support Doctrine/ORM older (< 2.4) version. + $reflection = new \ReflectionClass('Doctrine\ORM\Configuration'); + if (!$reflection->hasMethod('setRepositoryFactory')) { + return; + } + $entityManagerNames = array_keys($container->getParameter('doctrine.entity_managers')); foreach ($entityManagerNames as $emName) { diff --git a/composer.json b/composer.json index beeb94a..9ecf4cf 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "sensio/framework-extra-bundle": "~2.0|~3.0", "jms/security-extra-bundle": "~1.0", "doctrine/doctrine-bundle": "~1.5", - "doctrine/orm": "~2.3", + "doctrine/orm": "~2.4", "phpcollection/phpcollection": ">=0.2,<0.3-dev", "symfony/phpunit-bridge": "~3.3", "phpunit/phpunit": "^4.8.35|^5.4.4|^6.0.0",