public function get(int $offset): Period
    {
        $period = $this->intervals[$offset] ?? null;
        if (null !== $period) {
            return $period;
        }

        throw new InvalidIndex(sprintf('%s is an invalid offset in the current sequence', $offset));
    }
public function get(int $offset): Period
    {
        $period = $this->intervals[$offset] ?? null;
        if (null !== $period) {
            return $period;
        }

        throw new InvalidIndex(sprintf('%s is an invalid offset in the current sequence', $offset));
    }
public function get ( int $ offset ) : Period { $ period = $ this -> intervals [ $ offset ] ?? null ; if ( null !== $ period ) { return $ period ; } throw new InvalidIndex ( sprintf ( '%s is an invalid offset in the current sequence' , $ offset ) ) ; }
Returns the interval specified at a given offset.

@throws InvalidIndex If the offset is illegal for the current sequence
Returns the interval specified at a given offset .