Skip to content

Commit a8413ea

Browse files
committed
Stronger deprecation of doctrine/cache
1 parent 718826c commit a8413ea

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"require": {
2929
"php": "^8.1",
3030
"ext-mongodb": "^1.21 || ^2.0",
31-
"doctrine/cache": "^1.11 || ^2.0",
31+
"doctrine/cache": "^2.0",
3232
"doctrine/collections": "^1.5 || ^2.0",
3333
"doctrine/event-manager": "^1.0 || ^2.0",
3434
"doctrine/instantiator": "^1.1 || ^2",

src/Configuration.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,13 @@ public function getMetadataDriverImpl(): ?MappingDriver
276276
return $this->attributes['metadataDriverImpl'] ?? null;
277277
}
278278

279+
/** @deprecated Since 2.2, use {@see getMetadataCache()} instead. */
279280
public function getMetadataCacheImpl(): ?Cache
280281
{
282+
if (! interface_exists(Cache::class)) {
283+
throw new LogicException('The "doctrine/cache" package is deprecated and no longer installed with "doctrine/mongodb-odm". Require .');
284+
}
285+
281286
trigger_deprecation(
282287
'doctrine/mongodb-odm',
283288
'2.2',
@@ -289,6 +294,7 @@ public function getMetadataCacheImpl(): ?Cache
289294
return $this->attributes['metadataCacheImpl'] ?? null;
290295
}
291296

297+
/** @deprecated Since 2.2, use {@see setMetadataCache()} instead. */
292298
public function setMetadataCacheImpl(Cache $cacheImpl): void
293299
{
294300
trigger_deprecation(

0 commit comments

Comments
 (0)