Commit 19ac1ec
authored
Enable native lazy objects for PHP 8.4+ (#25)
* Enable native lazy objects for PHP 8.4+
Use new non-deprecated Doctrine ORM API on PHP 8.4+ with Doctrine ORM 3.5+:
- Replace `ORMSetup::createAttributeMetadataConfiguration()` with `createAttributeMetadataConfig()`
- Enable native lazy objects via `$config->enableNativeLazyObjects(true)`
Falls back to the old API on older PHP/Doctrine versions for backward compatibility.
This addresses the following deprecations on PHP 8.4+:
- Doctrine\ORM\ORMSetup::createAttributeMetadataConfiguration is deprecated
- ProxyHelper::generateLazyGhost() is deprecated
- Symfony\Component\VarExporter\LazyGhostTrait is deprecated
* Fix native lazy objects compatibility and update test fixtures
- Add $number property to TestEntityWithId to ensure entities are never
empty (prevents PHP 8.4 from skipping proxy creation for id-only entities)
- Update EntityPreloader to check isUninitializedObject before getValue
to prevent accidental lazy initialization
- Update expected SQL queries in EntityPreloadSyntheticTest to account
for the new number column
- Add PHPStan ignore rules for test fixtures
* Enable native lazy objects for PHP 8.4+
Re-enable the native lazy objects feature now that tests have been
updated with the $number column to ensure entities are never empty.
* revert useless change
* x1 parent 937c060 commit 19ac1ec
File tree
3 files changed
+57
-44
lines changed- tests
- Fixtures/Synthetic
- Lib
3 files changed
+57
-44
lines changed
0 commit comments