-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11ac7b9
commit cec46f7
Showing
3 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...mproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/var_and_attribute.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?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\Training; | ||
|
||
#[ORM\Entity] | ||
class VarAndAttribute | ||
{ | ||
/** | ||
* @var Collection|Training[] | ||
*/ | ||
#[ORM\OneToMany(targetEntity:Training::class, mappedBy:"trainer")] | ||
private $trainings = []; | ||
|
||
public function setTrainings($trainings) | ||
{ | ||
$this->trainings = $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\Training; | ||
|
||
#[ORM\Entity] | ||
class VarAndAttribute | ||
{ | ||
/** | ||
* @var Collection<int, Training> | ||
*/ | ||
#[ORM\OneToMany(targetEntity:Training::class, mappedBy:"trainer")] | ||
private $trainings = []; | ||
|
||
/** | ||
* @param Collection|\Training[] $trainings | ||
*/ | ||
public function setTrainings($trainings) | ||
{ | ||
$this->trainings = $trainings; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters