Skip to content

Commit 84abbf2

Browse files
committed
chore: doctrine deprecations (#6237)
1 parent c017be6 commit 84abbf2

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
@@ -249,6 +249,7 @@ class_exists(NativePasswordHasher::class) ? 'password_hashers' : 'encoders' => [
249249
$c->prependExtensionConfig('doctrine', [
250250
'orm' => [
251251
'report_fields_where_declared' => true,
252+
'controller_resolver' => ['auto_mapping' => true],
252253
'enable_lazy_ghost_objects' => true,
253254
],
254255
]);

0 commit comments

Comments
 (0)