|
13 | 13 |
|
14 | 14 | use Composer\InstalledVersions; |
15 | 15 | use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
16 | | -use Doctrine\ORM\Mapping\AssociationMapping; |
17 | 16 | use Psr\Log\NullLogger; |
18 | 17 | use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
19 | 18 | use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
@@ -81,7 +80,7 @@ public function registerBundles(): iterable |
81 | 80 | protected function build(ContainerBuilder $container): void |
82 | 81 | { |
83 | 82 | // workaround https://github.com/symfony/symfony/issues/50322 |
84 | | - $container->addCompilerPass(new class() implements CompilerPassInterface { |
| 83 | + $container->addCompilerPass(new class implements CompilerPassInterface { |
85 | 84 | public function process(ContainerBuilder $container): void |
86 | 85 | { |
87 | 86 | $container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener'); |
@@ -197,11 +196,19 @@ protected function configureContainer(ContainerConfigurator $c): void |
197 | 196 |
|
198 | 197 | // https://github.com/doctrine/DoctrineBundle/pull/1661 |
199 | 198 | if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) { |
200 | | - $doctrineConfig['orm']['report_fields_where_declared'] = true; |
201 | 199 | $doctrineConfig['orm']['validate_xml_mapping'] = true; |
202 | 200 | $doctrineConfig['dbal']['schema_manager_factory'] = 'doctrine.dbal.default_schema_manager_factory'; |
203 | 201 | } |
204 | 202 |
|
| 203 | + // https://github.com/doctrine/DoctrineBundle/pull/1661 |
| 204 | + // https://github.com/doctrine/DoctrineBundle/pull/1962 |
| 205 | + if ( |
| 206 | + version_compare($doctrineBundleVersion, '2.9.0', '>=') |
| 207 | + && version_compare($doctrineBundleVersion, '3.0.0', '<') |
| 208 | + ) { |
| 209 | + $doctrineConfig['orm']['report_fields_where_declared'] = true; |
| 210 | + } |
| 211 | + |
205 | 212 | if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) { |
206 | 213 | $doctrineConfig['orm']['enable_native_lazy_objects'] = true; |
207 | 214 | } |
|
0 commit comments