Fix false positive inheritance deprecation for embeddable subclasses#12399
Open
isaackaara wants to merge 1 commit into
Open
Fix false positive inheritance deprecation for embeddable subclasses#12399isaackaara wants to merge 1 commit into
isaackaara wants to merge 1 commit into
Conversation
When an embeddable class extends another embeddable class, the check in ClassMetadataFactory incorrectly triggers the deprecation warning about missing inheritance mapping type declarations. Embeddable classes do not support inheritance mapping types, so the check should be skipped when the class is an embedded class. Fixes doctrine#11843
Contributor
|
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Member
|
Sorry, 2.20.x is closed for bugfixes. Please retarget to 3.6.x |
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.
What
When an embeddable class extends another embeddable class,
ClassMetadataFactoryincorrectly triggers a deprecation warning about a missing inheritance mapping type declaration.Why
The check at line 164 of
ClassMetadataFactory::doLoadMetadata()only guards againstisMappedSuperclass, but does not exclude embedded classes. Since embeddable classes cannot have inheritance mapping types, the deprecation should not fire for them.Fix
Added
&& ! $class->isEmbeddedClassto the condition so the deprecation is only triggered for regular entity classes, not embeddables.How to reproduce
Before this fix, loading metadata for
BoundedTimeframetriggers:After this fix, no deprecation is triggered.
Fixes #11843