Find the best Rector rule to solve your problem. Searching through 1007 rules.
Found 4 rules:
Adds @return PHPDoc type to Collection property getter by *ToMany annotation/attribute
-use App\Entity\Training;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
final class Trainer
{
/**
* @ORM\OneToMany(targetEntity=Training::class)
*/
private $trainings;
+ /**
+ * @return \Doctrine\Common\Collections\Collection<int, \App\Entity\Training>
+ */
public function getTrainings()
{
return $this->trainings;
}
}
Change default value types to match Doctrine annotation type
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*/
class User
{
/**
* @ORM\Column(name="is_old", type="boolean")
*/
- private $isOld = '0';
+ private $isOld = false;
}
Complete @var annotations or types based on @ORM\Column
use Doctrine\ORM\Mapping as ORM;
class SimpleColumn
{
/**
* @ORM\Column(type="string")
*/
- private $name;
+ private string|null $name = null;
}
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;
}