Skip to content

Commit

Permalink
more fixture for both attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 22, 2024
1 parent f84e8a5 commit 7244227
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Rector\Doctrine\Tests\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector\Fixture\OneToMany;

use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Rector\Doctrine\Tests\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector\Source\TrainingWithIntegerIdAttribute;

/**
* @ORM\Entity
*/
class WithIndexByIntegerAttributeOnBoth
{
/**
* @var Collection<int, string>|TrainingWithIntegerIdAttribute[]
*/
#[ORM\OneToMany(targetEntity: TrainingWithIntegerIdAttribute::class, mappedBy: 'trainer', indexBy: 'id')]
private $trainings = [];
}

?>
-----
<?php

namespace Rector\Doctrine\Tests\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector\Fixture\OneToMany;

use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Rector\Doctrine\Tests\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector\Source\TrainingWithIntegerIdAttribute;

/**
* @ORM\Entity
*/
class WithIndexByIntegerAttributeOnBoth
{
/**
* @var \Doctrine\Common\Collections\Collection<int, \Rector\Doctrine\Tests\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector\Source\TrainingWithIntegerIdAttribute>
*/
#[ORM\OneToMany(targetEntity: TrainingWithIntegerIdAttribute::class, mappedBy: 'trainer', indexBy: 'id')]
private $trainings = [];
}

?>

0 comments on commit 7244227

Please sign in to comment.