Skip to content

Commit f4bb5a7

Browse files
authored
Merge pull request #2103 from greg0ire/remove-option
Remove enable_native_lazy_objects
2 parents c95122c + 396a6ce commit f4bb5a7

File tree

6 files changed

+9
-60
lines changed

6 files changed

+9
-60
lines changed

UPGRADE-4.0.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
UPGRADE FROM 3 to 4
2+
===================
3+
4+
Configuration
5+
-------------
6+
7+
The `doctrine.orm.entity_managers.some_em.enable_native_lazy_objects`
8+
configuration option has been removed as native lazy objects are now always
9+
enabled.

docs/en/configuration.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ Configuration Reference
206206
orm:
207207
default_entity_manager: ~ # The first defined is used if not set
208208
209-
# No-op, will be deprecated and removed in the future
210-
enable_native_lazy_objects: true
211-
212209
identity_generation_preferences:
213210
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
214211

src/DependencyInjection/Configuration.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ private function addOrmSection(ArrayNodeDefinition $node): void
360360
// Key that should not be rewritten to the entity-manager config
361361
$excludedKeys = [
362362
'default_entity_manager' => true,
363-
'enable_native_lazy_objects' => true,
364363
'resolve_target_entities' => true,
365364
'resolve_target_entity' => true,
366365
'controller_resolver' => true,
@@ -404,18 +403,6 @@ private function addOrmSection(ArrayNodeDefinition $node): void
404403
->end()
405404
->children()
406405
->scalarNode('default_entity_manager')->end()
407-
->booleanNode('enable_native_lazy_objects')
408-
->defaultTrue()
409-
->validate()
410-
->ifTrue(static fn ($v) => $v === false)
411-
->thenInvalid('The setting "enable_native_lazy_objects" can no longer be disabled and should not be set')
412-
->end()
413-
->setDeprecated(
414-
'doctrine/doctrine-bundle',
415-
'3.1',
416-
'The "%node%" option is deprecated and will be removed in DoctrineBundle 4.0, as native lazy objects are now always enabled.',
417-
)
418-
->end()
419406
->arrayNode('controller_resolver')
420407
->canBeDisabled()
421408
->children()

tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
use Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator;
3333
use Symfony\Component\Cache\Adapter\ArrayAdapter;
3434
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
35-
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
3635
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
3736
use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
3837
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -1199,29 +1198,6 @@ public function testNativeLazyObjectsWithoutConfig(): void
11991198
$this->assertTrue($entityManager->getConfiguration()->isNativeLazyObjectsEnabled());
12001199
}
12011200

1202-
public function testNativeLazyObjectsWithConfigTrue(): void
1203-
{
1204-
if (! interface_exists(EntityManagerInterface::class)) {
1205-
self::markTestSkipped('This test requires ORM');
1206-
}
1207-
1208-
$container = $this->loadContainer('orm_native_lazy_objects_enable');
1209-
$entityManager = $container->get('doctrine.orm.entity_manager');
1210-
1211-
$this->assertTrue($entityManager->getConfiguration()->isNativeLazyObjectsEnabled());
1212-
}
1213-
1214-
#[RequiresMethod(ProxyHelper::class, 'generateLazyGhost')]
1215-
public function testNativeLazyObjectsWithConfigFalse(): void
1216-
{
1217-
if (! interface_exists(EntityManagerInterface::class)) {
1218-
self::markTestSkipped('This test requires ORM');
1219-
}
1220-
1221-
$this->expectException(InvalidConfigurationException::class);
1222-
$container = $this->loadContainer('orm_native_lazy_objects_disable');
1223-
}
1224-
12251201
/** @param list<string> $bundles */
12261202
private function loadContainer(
12271203
string $fixture,

tests/DependencyInjection/Fixtures/config/yml/orm_native_lazy_objects_disable.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/DependencyInjection/Fixtures/config/yml/orm_native_lazy_objects_enable.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)