Skip to content

Commit 5a2600f

Browse files
authored
chore: doctrine deprecations (#6237)
1 parent 3689ae5 commit 5a2600f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Test/DoctrineMongoDbOdmTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function createTestDocumentManager($paths = []): DocumentManager
3434
$config->setHydratorDir(sys_get_temp_dir());
3535
$config->setProxyNamespace('SymfonyTests\Doctrine');
3636
$config->setHydratorNamespace('SymfonyTests\Doctrine');
37-
$config->setMetadataDriverImpl(new AttributeDriver($paths, new AttributeReader()));
37+
$config->setMetadataDriverImpl(new AttributeDriver($paths, class_exists(\Doctrine\Common\Annotations\Reader::class) ? new AttributeReader() : null)); // @phpstan-ignore-line type is only documented as phpdoc
3838
$config->setMetadataCache(new ArrayAdapter());
3939

4040
return DocumentManager::create(null, $config);

tests/Fixtures/app/AppKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [
273273
$c->prependExtensionConfig('doctrine', [
274274
'orm' => [
275275
'report_fields_where_declared' => true,
276+
'controller_resolver' => ['auto_mapping' => true],
276277
'enable_lazy_ghost_objects' => true,
277278
],
278279
]);

0 commit comments

Comments
 (0)