diff --git a/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/no_var_attribute.php.inc b/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/no_var_attribute.php.inc index 1b2e7a79..3a74522a 100644 --- a/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/no_var_attribute.php.inc +++ b/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/no_var_attribute.php.inc @@ -2,7 +2,6 @@ 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; @@ -19,7 +18,6 @@ class NoVar 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; diff --git a/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/var_and_attribute.php.inc b/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/var_and_attribute.php.inc new file mode 100644 index 00000000..d8b12065 --- /dev/null +++ b/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/Fixture/OneToMany/var_and_attribute.php.inc @@ -0,0 +1,52 @@ +trainings = $trainings; + } +} + +?> +----- + + */ + #[ORM\OneToMany(targetEntity:Training::class, mappedBy:"trainer")] + private $trainings = []; + + /** + * @param Collection|\Training[] $trainings + */ + public function setTrainings($trainings) + { + $this->trainings = $trainings; + } +} + +?> diff --git a/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/config/configured_rule.php b/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/config/configured_rule.php index bd39405a..82715af5 100644 --- a/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/config/configured_rule.php +++ b/rules-tests/CodeQuality/Rector/Property/ImproveDoctrineCollectionDocTypeInEntityRector/config/configured_rule.php @@ -5,6 +5,6 @@ use Rector\Config\RectorConfig; use Rector\Doctrine\CodeQuality\Rector\Property\ImproveDoctrineCollectionDocTypeInEntityRector; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->rule(ImproveDoctrineCollectionDocTypeInEntityRector::class); -}; +return RectorConfig::configure() + ->withRules([ImproveDoctrineCollectionDocTypeInEntityRector::class]) + ->withPhpVersion(\Rector\ValueObject\PhpVersionFeature::ATTRIBUTES);