public function setDay(int $day) : self { if ($day < 1 || $day > 31) { throw new ComposerException('Day out of range.', ComposerException::DAY); } $this->day = $day; return $this; }