doctrine / orm

Doctrine Object Relational Mapper (ORM)
https://www.doctrine-project.org/projects/orm.html
MIT License
9.86k stars 2.5k forks source link

AssociationOverride bug #11390

Open kor3k opened 3 months ago

kor3k commented 3 months ago

Bug Report

Q A
BC Break no
Version >=2.19.2

Summary

this line: https://github.com/doctrine/orm/blob/e384978e0bd1bdced06755ee190adf7f713dd006/src/Mapping/AssociationOverride.php#L44

should be

if ($inverseJoinColumns instanceof InverseJoinColumn) { 

Current behavior

this works

    new ORM\AssociationOverride(
        inverseJoinColumns: [new ORM\InverseJoinColumn()],
    )

but this gives error

    new ORM\AssociationOverride(
        inverseJoinColumns: new ORM\InverseJoinColumn(), // not array
    )