start = $start; $this->end = $end; } /** * First open second (UTC). * * @return int */ public function get_start() { return $this->start; } /** * First closed second after the window (UTC). * * @return int */ public function get_end() { return $this->end; } /** * Whether an instant is inside: `start <= ts < end`. * * @param int $ts UTC timestamp. * @return bool */ public function contains( int $ts ) { return $this->start <= $ts && $ts < $this->end; } /** * The window as an array. * * @return array{start: int, end: int} */ public function to_array() { return array( 'start' => $this->start, 'end' => $this->end, ); } }