diff --git a/DependencyInjection/DoctrineExtension.php b/DependencyInjection/DoctrineExtension.php index 56c4aa64d..0c627b62f 100644 --- a/DependencyInjection/DoctrineExtension.php +++ b/DependencyInjection/DoctrineExtension.php @@ -11,6 +11,9 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass; use Doctrine\Bundle\DoctrineBundle\EventSubscriber\EventSubscriberInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface; +use Doctrine\Common\Cache\CacheProvider; +use Doctrine\Common\Cache\Psr6\CacheAdapter; +use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connections\MasterSlaveConnection; use Doctrine\DBAL\Connections\PrimaryReadReplicaConnection; @@ -23,6 +26,7 @@ use Doctrine\ORM\Proxy\Autoloader; use Doctrine\ORM\UnitOfWork; use LogicException; +use Psr\Cache\CacheItemPoolInterface; use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension; use Symfony\Bridge\Doctrine\IdGenerator\UlidGenerator; use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator; @@ -34,9 +38,7 @@ use Symfony\Bridge\Doctrine\SchemaListener\RememberMeTokenProviderDoctrineSchemaSubscriber; use Symfony\Bridge\Doctrine\Validator\DoctrineLoader; use Symfony\Component\Cache\Adapter\ArrayAdapter; -use Symfony\Component\Cache\Adapter\DoctrineAdapter; use Symfony\Component\Cache\Adapter\PhpArrayAdapter; -use Symfony\Component\Cache\DoctrineProvider; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ChildDefinition; @@ -54,6 +56,7 @@ use function array_keys; use function class_exists; use function interface_exists; +use function is_a; use function method_exists; use function reset; use function sprintf; @@ -566,7 +569,7 @@ protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $ } $methods = [ - 'setMetadataCacheImpl' => new Reference(sprintf('doctrine.orm.%s_metadata_cache', $entityManager['name'])), + 'setMetadataCache' => new Reference(sprintf('doctrine.orm.%s_metadata_cache', $entityManager['name'])), 'setQueryCacheImpl' => new Reference(sprintf('doctrine.orm.%s_query_cache', $entityManager['name'])), 'setResultCacheImpl' => new Reference(sprintf('doctrine.orm.%s_result_cache', $entityManager['name'])), 'setMetadataDriverImpl' => new Reference('doctrine.orm.' . $entityManager['name'] . '_metadata_driver'), @@ -880,10 +883,10 @@ protected function getMappingResourceExtension(): string /** * {@inheritDoc} */ - protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheDriver, ContainerBuilder $container): string + protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheDriver, ContainerBuilder $container, bool $usePsr6 = false): string { - $serviceId = null; - $aliasId = $this->getObjectManagerElementName(sprintf('%s_%s', $objectManagerName, $cacheName)); + $aliasId = $this->getObjectManagerElementName(sprintf('%s_%s', $objectManagerName, $cacheName)); + $isPsr6 = null; switch ($cacheDriver['type'] ?? 'pool') { case 'service': @@ -892,8 +895,9 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD break; case 'pool': - $serviceId = $this->createPoolCacheDefinition($container, $cacheDriver['pool'] ?? $this->createArrayAdapterCachePool($container, $objectManagerName, $cacheName)); - + $pool = $cacheDriver['pool'] ?? $this->createArrayAdapterCachePool($container, $objectManagerName, $cacheName); + $serviceId = $pool; + $isPsr6 = true; break; default: @@ -905,6 +909,32 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD )); } + if ($isPsr6 === null) { + $definition = $container->getDefinition($serviceId); + $isPsr6 = is_a($definition->getClass(), CacheItemPoolInterface::class, true); + } + + $cacheName = str_replace('_cache', '', $cacheName); + + // Create a wrapper as required + if ($isPsr6 && ! $usePsr6) { + $wrappedServiceId = sprintf('doctrine.orm.cache.provider.%s.%s', $objectManagerName, $cacheName); + + $definition = $container->register($wrappedServiceId, CacheProvider::class); + $definition->setFactory([DoctrineProvider::class, 'wrap']); + $definition->addArgument(new Reference($serviceId)); + + $serviceId = $wrappedServiceId; + } elseif (! $isPsr6 && $usePsr6) { + $wrappedServiceId = sprintf('cache.doctrine.orm.adapter.%s.%s', $objectManagerName, $cacheName); + + $definition = $container->register($wrappedServiceId, CacheItemPoolInterface::class); + $definition->setFactory([CacheAdapter::class, 'wrap']); + $definition->addArgument(new Reference($serviceId)); + + $serviceId = $wrappedServiceId; + } + $container->setAlias($aliasId, new Alias($serviceId, false)); return $aliasId; @@ -917,9 +947,9 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD */ protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $container) { - $this->loadCacheDriver('metadata_cache', $entityManager['name'], $entityManager['metadata_cache_driver'], $container); - $this->loadCacheDriver('result_cache', $entityManager['name'], $entityManager['result_cache_driver'], $container); - $this->loadCacheDriver('query_cache', $entityManager['name'], $entityManager['query_cache_driver'], $container); + $this->loadCacheDriver('metadata_cache', $entityManager['name'], $entityManager['metadata_cache_driver'], $container, true); + $this->loadCacheDriver('result_cache', $entityManager['name'], $entityManager['result_cache_driver'], $container, false); + $this->loadCacheDriver('query_cache', $entityManager['name'], $entityManager['query_cache_driver'], $container, false); if ($container->getParameter('kernel.debug')) { return; @@ -1022,16 +1052,6 @@ private function loadMessengerServices(ContainerBuilder $container): void $transportFactoryDefinition->addTag('messenger.transport_factory'); } - private function createPoolCacheDefinition(ContainerBuilder $container, string $poolName): string - { - $serviceId = sprintf('doctrine.orm.cache.provider.%s', $poolName); - - $definition = $container->register($serviceId, DoctrineProvider::class); - $definition->addArgument(new Reference($poolName)); - - return $serviceId; - } - private function createArrayAdapterCachePool(ContainerBuilder $container, string $objectManagerName, string $cacheName): string { $id = sprintf('cache.doctrine.orm.%s.%s', $objectManagerName, str_replace('_cache', '', $cacheName)); @@ -1056,12 +1076,9 @@ private function registerMetadataPhpArrayCaching(string $entityManagerName, Cont ->addTag('kernel.cache_warmer', ['priority' => 1000]); // priority should be higher than ProxyCacheWarmer $container->setAlias($metadataCacheAlias, $phpArrayCacheDecoratorServiceId); - $container->register($phpArrayCacheDecoratorServiceId, DoctrineProvider::class) - ->addArgument( - new Definition(PhpArrayAdapter::class, [ - $phpArrayFile, - new Definition(DoctrineAdapter::class, [new Reference($decoratedMetadataCacheServiceId)]), - ]) - ); + + $container->register($phpArrayCacheDecoratorServiceId, PhpArrayAdapter::class) + ->addArgument($phpArrayFile) + ->addArgument(new Reference($decoratedMetadataCacheServiceId)); } } diff --git a/Tests/ContainerTest.php b/Tests/ContainerTest.php index fa4832f2e..7f82b52f1 100644 --- a/Tests/ContainerTest.php +++ b/Tests/ContainerTest.php @@ -6,6 +6,7 @@ use Doctrine\Bundle\DoctrineBundle\Command\Proxy\UpdateSchemaDoctrineCommand; use Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\Fixtures\DbalTestKernel; use Doctrine\Common\Annotations\Reader; +use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Doctrine\Common\EventManager; use Doctrine\DBAL\Configuration as DBALConfiguration; use Doctrine\DBAL\Connection; @@ -23,7 +24,7 @@ use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator; use Symfony\Bridge\Doctrine\Validator\DoctrineLoader; -use Symfony\Component\Cache\DoctrineProvider; +use Symfony\Component\Cache\Adapter\PhpArrayAdapter; use function class_exists; use function interface_exists; @@ -63,7 +64,7 @@ public function testContainer(): void $this->assertInstanceOf(Reader::class, $container->get('doctrine.orm.metadata.annotation_reader')); $this->assertInstanceOf(Configuration::class, $container->get('doctrine.orm.default_configuration')); $this->assertInstanceOf(MappingDriverChain::class, $container->get('doctrine.orm.default_metadata_driver')); - $this->assertInstanceOf(DoctrineProvider::class, $container->get('doctrine.orm.default_metadata_cache')); + $this->assertInstanceOf(PhpArrayAdapter::class, $container->get('doctrine.orm.default_metadata_cache')); $this->assertInstanceOf(DoctrineProvider::class, $container->get('doctrine.orm.default_query_cache')); $this->assertInstanceOf(DoctrineProvider::class, $container->get('doctrine.orm.default_result_cache')); $this->assertInstanceOf(EntityManager::class, $container->get('doctrine.orm.default_entity_manager')); diff --git a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php index b56cc63ed..61ca1a4aa 100644 --- a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php @@ -7,6 +7,7 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\EntityListenerPass; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\WellKnownSchemaFilterPass; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; +use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Connections\MasterSlaveConnection; use Doctrine\DBAL\Connections\PrimaryReadReplicaConnection; @@ -17,7 +18,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass; use Symfony\Component\Cache\Adapter\ArrayAdapter; -use Symfony\Component\Cache\DoctrineProvider; +use Symfony\Component\Cache\Adapter\PhpArrayAdapter; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -429,16 +430,16 @@ public function testLoadMultipleConnections(): void $this->assertEquals('doctrine.orm.em2_configuration', (string) $arguments[1]); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.em1_metadata_cache')); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); + $this->assertEquals(PhpArrayAdapter::class, $definition->getClass()); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.em1_query_cache')); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); + $this->assertEquals([DoctrineProvider::class, 'wrap'], $definition->getFactory()); $arguments = $definition->getArguments(); $this->assertInstanceOf(Reference::class, $arguments[0]); $this->assertEquals('cache.doctrine.orm.em1.query', (string) $arguments[0]); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.em1_result_cache')); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); + $this->assertEquals([DoctrineProvider::class, 'wrap'], $definition->getFactory()); $arguments = $definition->getArguments(); $this->assertInstanceOf(Reference::class, $arguments[0]); $this->assertEquals('cache.doctrine.orm.em1.result', (string) $arguments[0]); @@ -473,10 +474,10 @@ public function testEntityManagerMetadataCacheDriverConfiguration(): void $container = $this->loadContainer('orm_service_multiple_entity_managers'); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.em1_metadata_cache')); - $this->assertDICDefinitionClass($definition, DoctrineProvider::class); + $this->assertDICDefinitionClass($definition, PhpArrayAdapter::class); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.em2_metadata_cache')); - $this->assertDICDefinitionClass($definition, DoctrineProvider::class); + $this->assertDICDefinitionClass($definition, PhpArrayAdapter::class); } public function testDependencyInjectionImportsOverrideDefaults(): void @@ -487,11 +488,12 @@ public function testDependencyInjectionImportsOverrideDefaults(): void $container = $this->loadContainer('orm_imports'); - $cacheDefinition = $container->getDefinition((string) $container->getAlias('doctrine.orm.default_metadata_cache')); - $this->assertEquals(DoctrineProvider::class, $cacheDefinition->getClass()); - $configDefinition = $container->getDefinition('doctrine.orm.default_configuration'); $this->assertDICDefinitionMethodCallOnce($configDefinition, 'setAutoGenerateProxyClasses', ['%doctrine.orm.auto_generate_proxy_classes%']); + + $cacheDefinition = $container->getDefinition((string) $container->getAlias('doctrine.orm.default_metadata_cache')); + $this->assertEquals(PhpArrayAdapter::class, $cacheDefinition->getClass()); + $this->assertDICDefinitionMethodCallOnce($configDefinition, 'setMetadataCache', [new Reference('doctrine.orm.default_metadata_cache')]); } public function testSingleEntityManagerMultipleMappingBundleDefinitions(): void @@ -717,7 +719,7 @@ public function testSecondLevelCache(): void $this->assertDICDefinitionClass($myEntityRegionDef, '%doctrine.orm.second_level_cache.default_region.class%'); $this->assertDICDefinitionClass($loggerChainDef, '%doctrine.orm.second_level_cache.logger_chain.class%'); $this->assertDICDefinitionClass($loggerStatisticsDef, '%doctrine.orm.second_level_cache.logger_statistics.class%'); - $this->assertDICDefinitionClass($cacheDriverDef, DoctrineProvider::class); + $this->assertEquals([DoctrineProvider::class, 'wrap'], $cacheDriverDef->getFactory()); $this->assertDICDefinitionMethodCallOnce($configDef, 'setSecondLevelCacheConfiguration'); $this->assertDICDefinitionMethodCallCount($slcFactoryDef, 'setRegion', [], 3); $this->assertDICDefinitionMethodCallCount($loggerChainDef, 'setLogger', [], 3); diff --git a/Tests/DependencyInjection/DoctrineExtensionTest.php b/Tests/DependencyInjection/DoctrineExtensionTest.php index 3396f2018..e230f2218 100644 --- a/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -8,6 +8,8 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; use Doctrine\Bundle\DoctrineBundle\Tests\Builder\BundleConfigurationBuilder; use Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\Fixtures\Php8EntityListener; +use Doctrine\Common\Cache\Cache; +use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver\Connection as DriverConnection; use Doctrine\DBAL\Sharding\PoolingShardManager; @@ -20,9 +22,7 @@ use ReflectionClass; use Symfony\Bridge\Doctrine\Messenger\DoctrineClearEntityManagerWorkerSubscriber; use Symfony\Component\Cache\Adapter\ArrayAdapter; -use Symfony\Component\Cache\Adapter\DoctrineAdapter; use Symfony\Component\Cache\Adapter\PhpArrayAdapter; -use Symfony\Component\Cache\DoctrineProvider; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -450,33 +450,25 @@ public function testDependencyInjectionConfigurationDefaults(): void ); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.default_metadata_cache')); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); + $this->assertEquals(PhpArrayAdapter::class, $definition->getClass()); + $arguments = $definition->getArguments(); - $this->assertInstanceOf(Definition::class, $arguments[0]); - $this->assertEquals(PhpArrayAdapter::class, $arguments[0]->getClass()); - $arguments = $arguments[0]->getArguments(); $this->assertSame('%kernel.cache_dir%/doctrine/orm/default_metadata.php', $arguments[0]); - $this->assertInstanceOf(Definition::class, $arguments[1]); - $this->assertEquals(DoctrineAdapter::class, $arguments[1]->getClass()); - $arguments = $arguments[1]->getArguments(); - $this->assertInstanceOf(Reference::class, $arguments[0]); - $this->assertEquals('doctrine.orm.cache.provider.cache.doctrine.orm.default.metadata', (string) $arguments[0]); - $definition = $container->getDefinition((string) $arguments[0]); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); - $arguments = $definition->getArguments(); - $this->assertInstanceOf(Reference::class, $arguments[0]); - $this->assertEquals('cache.doctrine.orm.default.metadata', (string) $arguments[0]); - $this->assertSame(ArrayAdapter::class, $container->getDefinition((string) $arguments[0])->getClass()); + $this->assertInstanceOf(Reference::class, $arguments[1]); + $wrappedDefinition = (string) $arguments[1]; + + $definition = $container->getDefinition((string) $wrappedDefinition); + $this->assertSame(ArrayAdapter::class, $definition->getClass()); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.default_query_cache')); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); + $this->assertEquals([DoctrineProvider::class, 'wrap'], $definition->getFactory()); $arguments = $definition->getArguments(); $this->assertInstanceOf(Reference::class, $arguments[0]); $this->assertEquals('cache.doctrine.orm.default.query', (string) $arguments[0]); $this->assertSame(ArrayAdapter::class, $container->getDefinition((string) $arguments[0])->getClass()); $definition = $container->getDefinition((string) $container->getAlias('doctrine.orm.default_result_cache')); - $this->assertEquals(DoctrineProvider::class, $definition->getClass()); + $this->assertEquals([DoctrineProvider::class, 'wrap'], $definition->getFactory()); $arguments = $definition->getArguments(); $this->assertInstanceOf(Reference::class, $arguments[0]); $this->assertEquals('cache.doctrine.orm.default.result', (string) $arguments[0]); @@ -849,6 +841,7 @@ public function testOrmMergeConfigs(): void foreach ($calls as $call) { if ($call[0] === 'setAutoGenerateProxyClasses') { $this->assertFalse($container->getParameterBag()->resolveValue($call[1][0])); + break; } } @@ -977,22 +970,28 @@ public static function legacyCacheConfigurationProvider(): array return [ 'metadata_cache_default' => [ 'expectedAliasName' => 'doctrine.orm.default_metadata_cache', - 'expectedAliasTarget' => 'doctrine.orm.cache.provider.cache.doctrine.orm.default.metadata.php_array', + 'expectedAliasTarget' => 'cache.doctrine.orm.default.metadata.php_array', 'cacheName' => 'metadata_cache_driver', 'cacheConfig' => ['type' => null], ], 'metadata_cache_pool' => [ 'expectedAliasName' => 'doctrine.orm.default_metadata_cache', - 'expectedAliasTarget' => 'doctrine.orm.cache.provider.metadata_cache_pool.php_array', + 'expectedAliasTarget' => 'metadata_cache_pool.php_array', 'cacheName' => 'metadata_cache_driver', 'cacheConfig' => ['type' => 'pool', 'pool' => 'metadata_cache_pool'], ], 'metadata_cache_service' => [ 'expectedAliasName' => 'doctrine.orm.default_metadata_cache', - 'expectedAliasTarget' => 'service_target_metadata.php_array', + 'expectedAliasTarget' => 'cache.doctrine.orm.adapter.default.metadata.php_array', 'cacheName' => 'metadata_cache_driver', 'cacheConfig' => ['type' => 'service', 'id' => 'service_target_metadata'], ], + 'metadata_psr6_service' => [ + 'expectedAliasName' => 'doctrine.orm.default_metadata_cache', + 'expectedAliasTarget' => 'service_target_metadata_psr6.php_array', + 'cacheName' => 'metadata_cache_driver', + 'cacheConfig' => ['type' => 'service', 'id' => 'service_target_metadata_psr6'], + ], ]; } @@ -1002,25 +1001,25 @@ public static function cacheConfigurationProvider(): array return [ 'query_cache_default' => [ 'expectedAliasName' => 'doctrine.orm.default_query_cache', - 'expectedAliasTarget' => 'doctrine.orm.cache.provider.cache.doctrine.orm.default.query', + 'expectedAliasTarget' => 'doctrine.orm.cache.provider.default.query', 'cacheName' => 'query_cache_driver', 'cacheConfig' => ['type' => null], ], 'result_cache_default' => [ 'expectedAliasName' => 'doctrine.orm.default_result_cache', - 'expectedAliasTarget' => 'doctrine.orm.cache.provider.cache.doctrine.orm.default.result', + 'expectedAliasTarget' => 'doctrine.orm.cache.provider.default.result', 'cacheName' => 'result_cache_driver', 'cacheConfig' => ['type' => null], ], 'query_cache_pool' => [ 'expectedAliasName' => 'doctrine.orm.default_query_cache', - 'expectedAliasTarget' => 'doctrine.orm.cache.provider.query_cache_pool', + 'expectedAliasTarget' => 'doctrine.orm.cache.provider.default.query', 'cacheName' => 'query_cache_driver', 'cacheConfig' => ['type' => 'pool', 'pool' => 'query_cache_pool'], ], 'result_cache_pool' => [ 'expectedAliasName' => 'doctrine.orm.default_result_cache', - 'expectedAliasTarget' => 'doctrine.orm.cache.provider.result_cache_pool', + 'expectedAliasTarget' => 'doctrine.orm.cache.provider.default.result', 'cacheName' => 'result_cache_driver', 'cacheConfig' => ['type' => 'pool', 'pool' => 'result_cache_pool'], ], @@ -1134,6 +1133,11 @@ private function getContainer(array $bundles = ['YamlBundle'], string $vendor = $container->setDefinition('cache.system', (new Definition(ArrayAdapter::class))->setPublic(true)); $container->setDefinition('cache.app', (new Definition(ArrayAdapter::class))->setPublic(true)); $container->setDefinition('my_pool', (new Definition(ArrayAdapter::class))->setPublic(true)); + $container->setDefinition('my_cache', (new Definition(Cache::class))->setPublic(true)); + $container->setDefinition('service_target_metadata', (new Definition(Cache::class))->setPublic(true)); + $container->setDefinition('service_target_query', (new Definition(Cache::class))->setPublic(true)); + $container->setDefinition('service_target_result', (new Definition(Cache::class))->setPublic(true)); + $container->setDefinition('service_target_metadata_psr6', (new Definition(ArrayAdapter::class))->setPublic(true)); return $container; } diff --git a/composer.json b/composer.json index cbcaec2e7..5d3e7bc71 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ ], "require": { "php": "^7.1 || ^8.0", + "doctrine/cache": "^1.11 || ^2.0", "doctrine/dbal": "^2.9.0|^3.0", "doctrine/persistence": "^1.3.3|^2.0", "doctrine/sql-formatter": "^1.0.1", @@ -59,7 +60,7 @@ "sort-packages": true }, "conflict": { - "doctrine/orm": "<2.6", + "doctrine/orm": "<2.9", "twig/twig": "<1.34|>=2.0,<2.4" }, "suggest": {