The expression return $this->dateTime could return the type boolean which is incompatible with the type-hinted return DateTimeImmutable. Consider adding an additional type-check to rule them out.
Loading history...
21
}
22
23
/**
24
* If a DateTime instance is provided, it is converted to DateTimeImmutable.
25
*/
26
8
public function setDateTime(\DateTimeInterface $dateTime): void
27
{
28
8
if ($dateTime instanceof \DateTime) {
29
2
$immutable = new \DateTimeImmutable('@'.$dateTime->getTimestamp());