deathDate??null; } /** * @throws \DateMalformedStringException */ public function setDeathDate(Date|string $deathDate):void { if (is_string($deathDate)) { $deathDate = new Date($deathDate); } $this->deathDate = $deathDate; } }