Complete @var annotations or types based on @ORM\*toOne annotations or attributes
use Doctrine\ORM\Mapping as ORM;
class SimpleColumn
{
/**
* @ORM\OneToOne(targetEntity="App\Company\Entity\Company")
* @ORM\JoinColumn(nullable=false)
*/
- private $company;
+ private ?\App\Company\Entity\Company $company = null;
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\Doctrine\CodeQuality\Rector\Property\TypedPropertyFromToOneRelationTypeRector;
return RectorConfig::configure()
->withRules([
TypedPropertyFromToOneRelationTypeRector::class,
]);