Adds new intervals at the end of the sequence.

@param Period ...$intervals
320660
public function push(Period $interval, Period ...$intervals): void
    {
        $this->intervals = array_merge($this->intervals, [$interval], $intervals);
    }
394328
public function withIntervalInSeconds($intervalInSeconds)
    {
        $this->validateInterval($intervalInSeconds);

        $this->interval = $intervalInSeconds;
        $this->intervalUnit = IntervalUnit::SECOND;

        return $this;
    }
794842
public function add(DateInterval $interval)
	{
		return $this->modify(
			function (\DateTime $datetime) use ($interval)
			{
				$datetime->add($interval->getDateInterval());
			}
		);
	}
487126
public function plusMonths(int $months) : Period
    {
        if ($months === 0) {
            return $this;
        }

        return new Period($this->years, $this->months + $months, $this->days);
    }
547140
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);
    }
178483
def add(self, interval: Interval) -> None:
        
        if interval is None:
            return
        if not isinstance(interval, Interval):
            raise TypeError(
                "Attempt to insert non-Interval into IntervalList")
        self.intervals.append(interval)
        self._tidy()
1027252
function array_sum_intervals($array_external, $intervals){

        $n_intervals=explode(";", $intervals);
        $array_amount = count($n_intervals);
        $result = 0;
        for($i=0; $i < $array_amount ; $i++){
            $result += $this->array_sum_interval($array_external, $n_intervals[$i]);
        }
        return $result;

    }
429953
final public static function SetTokenPeriod( int $period ) : void {
        
        self::SetConfigFromSetter(
                $period,
                self::akTokenPeriod,
                self::ValidateTokenPeriod( )
        );
        
    }
1290073
public function dateAdd($number = 0, $interval = "d") {
        $hours =  $this->hour;
        $minutes =  $this->minute;
        $seconds =  $this->second;
        $month =  $this->month;
        $day =  $this->day;
        $year =  $this->year;

        switch ($interval) {
            case "yyyy":
                //---Add $number to year
                $year += $number;
                break;

            case "q":
                //---Add $number to quarter
                $month += ($number*3);
                break;

            case "m":
                //---Add $number to month
                $month += $number;
                break;

            case "y":
            case "d":
            case "w":
                //---Add $number to day of year, day, day of week
                $day += $number;
                break;

            case "ww":
                //---Add $number to week
                $day += ($number*7);
                break;

            case "h":
                //---Add $number to hours
                $hours += $number;
                break;

            case "n":
                //---Add $number to minutes
                $minutes += $number;
                break;

            case "s":
                //---Add $number to seconds
                $seconds += $number;
                break;
        }

        return (new Date(mktime($hours,
                                $minutes,
                                $seconds,
                                $month,
                                $day,
                                $year)));

    }
918358
public function add_events( array $stops ): void {

		$this->events = array_merge( $this->events, $stops );

		/**
		 * @var int|string $key
		 * @var array      $data
		 */
		foreach ( $stops as $key => $data ) {

			if ( is_int( $key ) ) {
				/** @var array{0:string} $data */
				$this->add_event( ...$data );
				continue;
			}

			/** @var int $priority */
			foreach ( array_keys( $data ) as $priority ) {
				add_action( $key, [ $this, 'tick' ], $priority );
			}
		}
	}
60374
protected function modifyFromInterval($interval, $invert = false)
	{
		if ($invert)
		{
			$this->sub($interval);
		}
		else
		{
			$this->add($interval);
		}

		return $this;
	}
136692
public function withIntervalInDays($intervalInDays)
    {
        $this->validateInterval($intervalInDays);
        $this->interval = $intervalInDays;
        $this->intervalUnit = IntervalUnit::DAY;

        return $this;
    }
554490
protected function divide_intervals(array $intervals)
    {
        if (count($intervals) === 0) {
            return null;
        }

        $x_center = $this->center($intervals);
        $s_center = array();
        $s_left = array();
        $s_right = array();

        foreach ($intervals as $k) {
            if ($k->getStart() > $k->getEnd()) {
                throw new NegativeRangeException(
                    'Range is negative (maybe you entered the range in reverse order?)'
                );
            }
            if ($this->compare($k->getEnd(), $x_center) < 0) {
                $s_left[] = $k;
            } elseif ($this->compare($k->getStart(), $x_center) > 0) {
                $s_right[] = $k;
            } else {
                $s_center[] = $k;
            }
        }

        return new TreeNode(
            $x_center,
            $s_center,
            $this->divide_intervals($s_left),
            $this->divide_intervals($s_right)
        );
    }
64218
public function abuts(Period $period)
	    {
	        return $this->start == $period->end || $this->end == $period->start;
	    }
314928
def _add_interval(all_intervals, new_interval):
        
        intervals = None
        old_interval = None
        for old_interval in all_intervals:
            intervals = Type2CondenseHelper._distinct(new_interval, old_interval)
            if intervals:
                break

        if intervals is None:
            all_intervals.add(new_interval)
        else:
            if old_interval:
                all_intervals.remove(old_interval)
            for distinct_interval in intervals:
                Type2CondenseHelper._add_interval(all_intervals, distinct_interval)
436941
public function withDays(int $days) : Period
    {
        if ($days === $this->days) {
            return $this;
        }

        return new Period($this->years, $this->months, $days);
    }
633824
public function each(\DateInterval $interval, \Closure $callback)
    {
        $period = new static($this->start(), $this->start()->add($interval));

        do {
            $callback(new static(
                $period->start(),
                $period->end() > $this->endDate ? $this->endDate : $period->end()
            ));
        } while ($period->add($interval)->start() < $this->endDate);

        return $this;
    }