at = clone $at; $this->for = clone $for; } public function getAt(): \DateTimeImmutable { return $this->at instanceof \DateTimeImmutable ? $this->at : \DateTimeImmutable::createFromInterface($this->at); } public function getFor(): \DateInterval { return $this->for; } public function getEndsAt(): \DateTimeImmutable { return $this->getAt()->add($this->for); } public function __toString(): string { return sprintf( '%s (%s)', $this->getAt()->format(\DateTimeInterface::RFC3339), CarbonInterval::instance($this->for)->spec() ); } }