public function insert(int $offset, Period $interval, Period ...$intervals): void
    {
        if ($offset < 0 || $offset > count($this->intervals)) {
            throw new InvalidIndex(sprintf('%s is an invalid offset in the current sequence', $offset));
        }

        array_unshift($intervals, $interval);
        array_splice($this->intervals, $offset, 0, $intervals);
    }
public function insert(int $offset, Period $interval, Period ...$intervals): void
    {
        if ($offset < 0 || $offset > count($this->intervals)) {
            throw new InvalidIndex(sprintf('%s is an invalid offset in the current sequence', $offset));
        }

        array_unshift($intervals, $interval);
        array_splice($this->intervals, $offset, 0, $intervals);
    }
public function insert ( int $ offset , Period $ interval , Period ... $ intervals ) : void { if ( $ offset < 0 || $ offset > count ( $ this -> intervals ) ) { throw new InvalidIndex ( sprintf ( '%s is an invalid offset in the current sequence' , $ offset ) ) ; } array_unshift ( $ intervals , $ interval ) ; array_splice ( $ this -> intervals , $ offset , 0 , $ intervals ) ; }
Inserts new intervals at the specified offset of the sequence.

The sequence is re-indexed after addition

@param Period ...$intervals

@throws InvalidIndex If the offset is illegal for the current sequence.
Inserts new intervals at the specified offset of the sequence .