from = $from; $this->to = $to; $this->price = $price; $this->reduced = $reduced; } public function is_empty(): bool { return null !== $this->to && $this->to <= $this->from; } public function covers( int $ts ): bool { return $this->from <= $ts && ( null === $this->to || $this->to > $ts ); } /** Overlaps the half-open range [start, end). */ public function overlaps( int $start, int $end ): bool { return $this->from < $end && ( null === $this->to || $this->to > $start ); } }