You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Configuration.php
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@
36
36
usePsr\Cache\CacheItemPoolInterface;
37
37
useReflectionClass;
38
38
usestdClass;
39
+
useSymfony\Component\VarExporter\LazyGhostTrait;
39
40
useThrowable;
40
41
41
42
usefunctionarray_diff_key;
@@ -44,6 +45,7 @@
44
45
usefunctionclass_exists;
45
46
usefunctioninterface_exists;
46
47
usefunctionis_string;
48
+
usefunctiontrait_exists;
47
49
usefunctiontrigger_deprecation;
48
50
usefunctiontrim;
49
51
@@ -695,12 +697,18 @@ public function setUseLazyGhostObject(bool $flag): void
695
697
thrownewLogicException('Cannot enable or disable LazyGhostObject when native lazy objects are enabled.');
696
698
}
697
699
698
-
if ($flag === false) {
700
+
if ($flag && ! trait_exists(LazyGhostTrait::class)) {
701
+
thrownewLogicException('Package "symfony/var-exporter" >= 8.0 does not provide lazy ghost objects, use native lazy objects instead.');
702
+
}
703
+
704
+
if (! $flag) {
699
705
if (! class_exists(ProxyManagerConfiguration::class)) {
700
706
thrownewLogicException('Package "friendsofphp/proxy-manager-lts" is required to disable LazyGhostObject.');
701
707
}
702
708
703
-
trigger_deprecation('doctrine/mongodb-odm', '2.10', 'Using "friendsofphp/proxy-manager-lts" is deprecated. Use "symfony/var-exporter" LazyGhostObjects instead.');
709
+
if (PHP_VERSION_ID < 80400) {
710
+
trigger_deprecation('doctrine/mongodb-odm', '2.10', 'Using "friendsofphp/proxy-manager-lts" is deprecated. Use "symfony/var-exporter" LazyGhostObjects instead.');
0 commit comments