Skip to content

Commit 5b8ba0f

Browse files
authored
Merge branch '2.16.x' into doctrine-cache
2 parents 9fda64e + 7374131 commit 5b8ba0f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

UPGRADE-2.16.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,11 @@ If you use `Doctrine\ODM\MongoDB\Configuration::getMetadataCacheImpl()`,
66
then you need to require `doctrine/cache` explicitly in `composer.json`;
77
or use `Doctrine\ODM\MongoDB\Configuration::getMetadataCache()` instead.
88

9+
## Lazy Proxy Directory
10+
11+
Using proxy classes with PHP 8.4+ is deprecated, only native lazy objects will
12+
be supported in MongoDB ODM 3.0.
13+
14+
Calling `Doctrine\ODM\MongoDB\Configuration::setProxyDir()` or
15+
`Doctrine\ODM\MongoDB\Configuration::getProxyDir()` is deprecated and triggers
16+
a deprecation notice when using native lazy objects.

src/Configuration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ public function setMetadataCache(CacheItemPoolInterface $cache): void
327327

328328
/**
329329
* Sets the directory where Doctrine generates any necessary proxy class files.
330+
*
331+
* @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled.
330332
*/
331333
public function setProxyDir(string $dir): void
332334
{
@@ -336,9 +338,15 @@ public function setProxyDir(string $dir): void
336338

337339
/**
338340
* Gets the directory where Doctrine generates any necessary proxy class files.
341+
*
342+
* @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled.
339343
*/
340344
public function getProxyDir(): ?string
341345
{
346+
if ($this->isNativeLazyObjectEnabled()) {
347+
trigger_deprecation('doctrine/mongodb-odm', '2.16', 'Using "%s" is deprecated when native lazy objects are enabled.', __METHOD__);
348+
}
349+
342350
return $this->attributes['proxyDir'] ?? null;
343351
}
344352

0 commit comments

Comments
 (0)