Orm: Make use of DocBlock var annotation in annotation mappings

Created on 16 Apr 2019  路  3Comments  路  Source: doctrine/orm

Feature Request

Use type provided by @var annotation as fallback, if type of column or targetEntity of relation is not defined

| Q | A
|------------ | ------
| New Feature | yes
| RFC | yes
| BC Break | yes

Summary

While writing my entity annotations today, I suddenly wondered: Why can't we use the DocBlock var Annotations as default value for column type definition and targetEntity of relation mappings? In a lot of cases, they just duplicate each other.

I searched for similiar feature requests, but haven't found one. Are there any notable concerns against using another annotation as a default?

Edit

Currently, the default value of Column::type is string, even though it is defined as mandatory in the documentation. So changing the behavior would be a BC Break, I guess.

New Feature Question

Most helpful comment

@goatfryed it would probably be more interesting to use typed properties from PHP 7.4 in master, at this point

All 3 comments

@goatfryed it would probably be more interesting to use typed properties from PHP 7.4 in master, at this point

And why YAML driver is deprecated? I don't want to write XML

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sc0rp10 picture sc0rp10  路  4Comments

dmaicher picture dmaicher  路  3Comments

weaverryan picture weaverryan  路  3Comments

doctrinebot picture doctrinebot  路  4Comments

Inmmelman picture Inmmelman  路  3Comments