Complete @var annotations or types based on @ORM\*toMany annotations or attributes
use Doctrine\ORM\Mapping as ORM;
class SimpleColumn
{
/**
* @ORM\OneToMany(targetEntity="App\Product")
+ * @var \Doctrine\Common\Collections\Collection<int, \App\Product>
*/
- private $products;
+ private \Doctrine\Common\Collections\Collection $products;
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Doctrine\CodeQuality\Rector\Property\TypedPropertyFromToManyRelationTypeRector;
return RectorConfig::configure()
->withRules([
TypedPropertyFromToManyRelationTypeRector::class,
]);