rector
rector copied to clipboard
Doctrine Annotation to Attributes - InverseJoinColumn is converted to JoinColumn
Rector version: https://github.com/rectorphp/rector/commit/80bfee9246e1b57194c2119558962a2983bd2798 Update: I run this under PHP 8.1.
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES
The InverseJoinColumn ist not converted correct. It is converted to JoinColumn.
Before:
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Liste")
* @ORM\JoinTable(name="liste_kontingente",
* joinColumns={@ORM\JoinColumn(name="kontingent_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="liste_id", referencedColumnName="id")}
* )
*/
protected Collection $listen;
After:
#[ORM\ManyToMany(targetEntity: Liste::class)]
#[ORM\JoinTable(name: 'liste_kontingente', joinColumns: [], inverseJoinColumns: [])]
#[ORM\JoinColumn(name: 'kontingent_id', referencedColumnName: 'id')]
#[ORM\JoinColumn(name: 'liste_id', referencedColumnName: 'id')]
protected Collection $listen;
Correct:
#[ORM\ManyToMany(targetEntity: Liste::class)]
#[ORM\JoinTable(name: 'liste_kontingente', joinColumns: [], inverseJoinColumns: [])]
#[ORM\JoinColumn(name: 'kontingent_id', referencedColumnName: 'id')]
#[ORM\InverseJoinColumn(name: 'liste_id', referencedColumnName: 'id')]
protected Collection $listen;
@acrobat this maybe similar issue with issue that you resolve on PR
- https://github.com/rectorphp/rector-src/pull/2699
Could you verify it and possible provide a patch for it? Thank you.
Thank you @Chris53897 for reporting this issue. I can see rector did the same error in my app that I'm migrating right now.
The solution is on the way :grinning: :+1: See https://github.com/rectorphp/rector-src/pull/2781