-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Given the following property
#[ORM\Column(type: 'datetimetz_immutable', nullable: false)]
protected ?DateTimeInterface $date;
generated output will be:
public function setDate(?\DateTimeImmutable $date): self
{
$this->date = $date;
return $this;
}
public function getDate(): ?\DateTimeImmutable
{
return $this->date;
}
(note that typehint is \DateTimeImmutable, not \DateTimeInterface)
While this is technically correct from Doctrine's point of view, it will be better to prefer interface as typehint, especially when it is explicitly used in property's type.
Metadata
Metadata
Assignees
Labels
No labels