Repository navigation
Allow doctrine/orm:^3 - #47
Merged
Merged
Conversation
Code changes needed for ORM 3, verified to keep working on ORM 2.19.7+ as well by running the full suite against both: - Doctrine\ORM\Mapping\ClassMetadataInfo is removed entirely in ORM 3; its ONE_TO_ONE/TO_MANY constants now live directly on ClassMetadata. - ORM 3's now-default native lazy objects are plain instances of the entity's own class, not a generated proxy subclass implementing Doctrine\Persistence\Proxy, so `$entity instanceof Proxy` silently stops detecting uninitialized entities. Replaced with UnitOfWork::isUninitializedObject(), which exists on both ORM 2.19.7+ and ORM 3 and is the mechanism ORM 3 itself uses internally. Also declare doctrine/dbal and doctrine/collections directly, since EntityMutationMetadataProvider/EntityChangedEvent use their classes (DriverManager in tests, ArrayCollection/Collection) directly rather than only transitively through doctrine/orm. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
phpcs is doctrine/orm-version-independent, so running it once per
matrix cell was pure duplicate work. composer.lock is gitignored here
and never checked out in CI, so hashFiles('**/composer.lock') always
evaluated to empty and the cache key never actually varied with
dependency changes; composer.json is the file that's actually present
and signals when the resolved graph might differ.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
janlam7
added a commit
to janlam7/entity-tracker-component
that referenced
this pull request
Oct 14, 2026
PHP 8.4 + doctrine/orm ^3 failed in CI (job 115870862309 on PR hostnet#47): Doctrine\ORM\ORMInvalidArgumentException: Symfony LazyGhost is not available. Please install the "symfony/var-exporter" package version 6.4 or 7 to use this feature or enable PHP 8.4 native lazy objects. Reproduced locally: on PHP 8.4, composer resolves symfony/var-exporter to 8.x (which removed the LazyGhostTrait-based proxy generation ORM 3 falls back to by default), while on PHP 8.3 it stays below 8.0, which is why only the PHP 8.4 / ORM 3 matrix cell failed. ORM 3's Configuration::isNativeLazyObjectsEnabled() defaults to false and has to be explicitly enabled to use PHP 8.4's native lazy objects instead of the var-exporter-based fallback; guarded with method_exists() since ORM 2's Configuration doesn't have this method at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
janlam7
added a commit
to janlam7/entity-tracker-component
that referenced
this pull request
Oct 14, 2026
PHP 8.4 + doctrine/orm ^3 failed in CI (job 115870862309 on PR hostnet#47): Doctrine\ORM\ORMInvalidArgumentException: Symfony LazyGhost is not available. Please install the "symfony/var-exporter" package version 6.4 or 7 to use this feature or enable PHP 8.4 native lazy objects. ORM 3's ProxyFactory defaults to generating a proxy subclass via symfony/var-exporter's LazyGhostTrait (the same Doctrine\Persistence\Proxy-implementing shape ORM 2 has always used), unless Configuration::isNativeLazyObjectsEnabled() is explicitly turned on. On PHP 8.4, composer resolves symfony/var-exporter to 8.x, which removed that trait entirely; on PHP 8.3 it stays below 8.0, which is why only the PHP 8.4 / ORM 3 matrix cell failed. Pinning symfony/var-exporter (a transitive, test-only dependency here) to ^6.3.9|^7.0 keeps every matrix cell on the long-standing generated- proxy mechanism rather than opting into ORM 3's native lazy objects, which would be a real behavioral change (lazy-loaded entities become plain instances of their own class instead of a Proxy-implementing subclass) better evaluated deliberately than as an incidental CI fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
janlam7
force-pushed
the
orm-upgrade
branch
3 times, most recently
from
October 14, 2026 13:25
1d0529d to
63facb8
Compare
ORM 3's ProxyFactory defaults to generating a proxy subclass via symfony/var-exporter's LazyGhostTrait (the same Doctrine\Persistence\Proxy-implementing shape ORM 2 has always used), unless Configuration::isNativeLazyObjectsEnabled() is explicitly turned on. On PHP 8.4, composer resolves symfony/var-exporter to 8.x, which removed that trait entirely; on PHP 8.3 it stays below 8.0, which is why only the PHP 8.4 / ORM 3 matrix cell failed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
phonixor
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.