Remove targetDocument autocompletion #2442
Merged
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.
This dodges a BC break, probably not impacting a lot of users but still a BC break. I use single reference as an example but same goes for
EmbedOne
. Currentlyis a perfectly fine mapping that allows user to have a reference to any document (from ODM's perspective) as long as it extends
BaseDocument
(from PHP's perspective). With #2411 due to autocompletion for typed properties this would become (implicitly):which is wrong. This could be worked around by an explicit
targetDocument=false
in the mapping but that would then require us to widentargetDocument
to allow|false
. As we want to get 2.4.0 out of the door let's defer the decision and work to future us.If we ever get to implementing this feature there's a number of edge cases we'll need to consider as well. All I've found so far involve having typed properties and discriminators (be it maps or anything else hinting discriminators may be in use). Hopefully these will be easier to spot with my next PR which will move autocompleting types before some mapping sanity checks.