From 91a9ffcae345dc3216de5f8fe421c1543488c3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 14 Nov 2025 22:28:40 +0100 Subject: [PATCH 1/2] Deprecate Configuration::(get|set)ProxyDir --- src/Configuration.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Configuration.php b/src/Configuration.php index 8e1faf488..6a3e8724c 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -316,6 +316,8 @@ public function setMetadataCache(CacheItemPoolInterface $cache): void /** * Sets the directory where Doctrine generates any necessary proxy class files. + * + * @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled. */ public function setProxyDir(string $dir): void { @@ -325,9 +327,15 @@ public function setProxyDir(string $dir): void /** * Gets the directory where Doctrine generates any necessary proxy class files. + * + * @deprecated Since 2.16, proxy directory is no longer used when native lazy objects are enabled. */ public function getProxyDir(): ?string { + if ($this->isNativeLazyObjectEnabled()) { + trigger_deprecation('doctrine/mongodb-odm', '2.16', 'Using "%s" is deprecated when native lazy objects are enabled.', __METHOD__); + } + return $this->attributes['proxyDir'] ?? null; } From 9f7b7b4738af130fdb97ca1d2840cf974df4ba51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 18 Nov 2025 19:28:42 +0100 Subject: [PATCH 2/2] Add upgrade instructions --- UPGRADE-2.16.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 UPGRADE-2.16.md diff --git a/UPGRADE-2.16.md b/UPGRADE-2.16.md new file mode 100644 index 000000000..66ff97d75 --- /dev/null +++ b/UPGRADE-2.16.md @@ -0,0 +1,10 @@ +# UPGRADE FROM 2.15 to 2.16 + +## Lazy Proxy Directory + +Using proxy classes with PHP 8.4+ is deprecated, only native lazy objects will +be supported in MongoDB ODM 3.0. + +Calling `Doctrine\ODM\MongoDB\Configuration::setProxyDir()` or +`Doctrine\ODM\MongoDB\Configuration::getProxyDir()` is deprecated and triggers +a deprecation notice when using native lazy objects.