Skip to content

Commit ca8f626

Browse files
committed
Add compatibility with doctrine/doctrine-bundle:^3.0.0
1 parent 7983aa9 commit ca8f626

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

src/Autocomplete/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"require-dev": {
3535
"doctrine/collections": "^1.6.8|^2.0",
36-
"doctrine/doctrine-bundle": "^2.4.3",
36+
"doctrine/doctrine-bundle": "^2.4.3|^3.0.0",
3737
"doctrine/orm": "^2.9.4|^3.0",
3838
"fakerphp/faker": "^1.22",
3939
"mtdowling/jmespath.php": "^2.6",

src/Autocomplete/tests/Fixtures/Kernel.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ protected function configureContainer(ContainerConfigurator $c): void
113113
$doctrineConfig = [
114114
'dbal' => ['url' => '%env(resolve:DATABASE_URL)%'],
115115
'orm' => [
116-
'auto_generate_proxy_classes' => true,
117116
'auto_mapping' => true,
118117
'mappings' => [
119118
'Test' => [
@@ -133,8 +132,12 @@ protected function configureContainer(ContainerConfigurator $c): void
133132
];
134133
}
135134
if (null !== $doctrineBundleVersion = InstalledVersions::getVersion('doctrine/doctrine-bundle')) {
136-
if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) {
137-
$doctrineConfig['orm']['enable_lazy_ghost_objects'] = true;
135+
if (version_compare($doctrineBundleVersion, '3.0.0', '<')) {
136+
$doctrineConfig['orm']['auto_generate_proxy_classes'] = true;
137+
138+
if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) {
139+
$doctrineConfig['orm']['enable_lazy_ghost_objects'] = true;
140+
}
138141
}
139142
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {
140143
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;

src/LiveComponent/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"require-dev": {
3838
"doctrine/annotations": "^1.0|^2.0",
3939
"doctrine/collections": "^1.6.8|^2.0",
40-
"doctrine/doctrine-bundle": "^2.4.3",
40+
"doctrine/doctrine-bundle": "^2.4.3|^3.0.0",
4141
"doctrine/orm": "^2.9.4|^3.0",
4242
"doctrine/persistence": "^2.5.2|^3.0",
4343
"phpdocumentor/reflection-docblock": "5.x-dev",

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ protected function configureContainer(ContainerConfigurator $c): void
162162
'url' => '%env(resolve:DATABASE_URL)%',
163163
],
164164
'orm' => [
165-
'auto_generate_proxy_classes' => true,
166165
'auto_mapping' => true,
167166
'mappings' => [
168167
'Default' => [
@@ -184,18 +183,23 @@ protected function configureContainer(ContainerConfigurator $c): void
184183
];
185184

186185
if (null !== $doctrineBundleVersion = InstalledVersions::getVersion('doctrine/doctrine-bundle')) {
187-
if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) {
188-
$doctrineConfig['orm']['enable_lazy_ghost_objects'] = true;
186+
if (version_compare($doctrineBundleVersion, '3.0.0', '<')) {
187+
$doctrineConfig['orm']['auto_generate_proxy_classes'] = true;
188+
189+
if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) {
190+
$doctrineConfig['orm']['enable_lazy_ghost_objects'] = true;
191+
}
192+
if (version_compare($doctrineBundleVersion, '2.12.0', '>=')) {
193+
$doctrineConfig['orm']['controller_resolver']['auto_mapping'] = false;
194+
}
189195
}
196+
190197
// https://github.com/doctrine/DoctrineBundle/pull/1661
191198
if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) {
192199
$doctrineConfig['orm']['report_fields_where_declared'] = true;
193200
$doctrineConfig['orm']['validate_xml_mapping'] = true;
194201
$doctrineConfig['dbal']['schema_manager_factory'] = 'doctrine.dbal.default_schema_manager_factory';
195202
}
196-
if (version_compare($doctrineBundleVersion, '2.12.0', '>=')) {
197-
$doctrineConfig['orm']['controller_resolver']['auto_mapping'] = false;
198-
}
199203
if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) {
200204
$doctrineConfig['orm']['enable_native_lazy_objects'] = true;
201205
}

src/Turbo/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"symfony/stimulus-bundle": "^2.9.1"
3939
},
4040
"require-dev": {
41-
"doctrine/doctrine-bundle": "^2.4.3",
41+
"doctrine/doctrine-bundle": "^2.4.3|^3.0.0",
4242
"doctrine/orm": "^2.8|^3.0",
4343
"phpstan/phpstan": "^2.1.17",
4444
"symfony/asset-mapper": "^6.4|^7.0|^8.0",

0 commit comments

Comments
 (0)