mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Opinion needed for constructor promotion #6608
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zmitic on GitHub (Jan 18, 2021).
Recommended usage is to use annotations but with PHP8, would XML make more sense?
Previously:
vs
and some xml. It is pretty decent removal of boilerplate code and just for one property.
Notes
$this->children = new ArrayCollection()but it is very rare I use m2m, or bidirectional relationIs there something I am missing?
@dbrumann commented on GitHub (Jan 18, 2021):
As far as I can tell your problem is that properties feel redundant in PHP 8 and are only necessary for putting the annotations on there. This should be solvable in the future with Attributes (when they become available, see #8266):
@beberlei commented on GitHub (Jan 18, 2021):
This is not an issue, but a discussion topic. Doctrine works with ctor promotion. Please write to the mailing list or discuss this in the Doctrine Slack.