-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#2735Labels
Description
Hi, Thanks a lot for your work.
Rector version: 80bfee9
Int-Indexed DiscriminatorMap lose there index after the conversion.
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES
The index is getting lost. It starts with 0.
Problem: Doctrine does not find the entites anymore.
Before:
/**
* @ORM\Entity
* @ORM\Table(name="tour_rbgl_billing")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="item_type", type="integer")
* @ORM\DiscriminatorMap({ "1" = "CostDetailEntity" })
*/
After:
#[ORM\Entity]
#[ORM\Table(name: 'tour_rbgl_billing')]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'item_type', type: 'integer')]
#[ORM\DiscriminatorMap(['CostDetailEntity'])]
Expected Behaviour
The index should be preserved.
#[ORM\DiscriminatorMap([1 => 'CostDetailEntity'])]
Special Case would be 0,1,2...N with increment by 1. In this case the actual behaviour is correct.