Specify an interval in the IntervalUnit.WEEK that the produced
Trigger will repeat at.

@param int $intervalInWeeks the number of weeks at which the trigger should repeat.

@return CalendarIntervalScheduleBuilder
507713
public function withIntervalInWeeks($intervalInWeeks)
    {
        $this->validateInterval($intervalInWeeks);
        $this->interval = $intervalInWeeks;
        $this->intervalUnit = IntervalUnit::WEEK;

        return $this;
    }
564128
public function setWeekOffset($weekOffset) {
        $weekOffset = Assert::isInt($weekOffset);
        if($weekOffset > 6 || $weekOffset < 0) {
            throw new InvalidArgumentException('Week Offset must be between 0 and 6');
        }
        $this->weekOffset = $weekOffset;
    }
293509
public function build(): SetSamplingIntervalRequest
	{
		$instance = new SetSamplingIntervalRequest();
		if ($this->interval === null) {
			throw new BuilderException('Property [interval] is required.');
		}
		$instance->interval = $this->interval;
		return $instance;
	}
574065
public function withYear(int $year) : YearWeek
    {
        if ($year === $this->year) {
            return $this;
        }

        Field\Year::check($year);

        $week = $this->week;

        if ($week === 53 && ! Field\WeekOfYear::is53WeekYear($year)) {
            $week = 52;
        }

        return new YearWeek($year, $week);
    }
1132375
public WeeklyAutoScalingSchedule withSunday(java.util.Map<String, String> sunday) {
        setSunday(sunday);
        return this;
    }
262774
public function setFrequency(int $frequency): AlarmInterface
    {
        $recurrence = "ON_";
        foreach ($this->days as $key => $val) {
            if ($frequency & $val) {
                $recurrence .= $key;
            }
        }

        if ($recurrence === "ON_") {
            $recurrence = "ONCE";
        } elseif ($recurrence === "ON_0123456") {
            $recurrence = "DAILY";
        } elseif ($recurrence === "ON_01234") {
            $recurrence = "WEEKDAYS";
        } elseif ($recurrence === "ON_56") {
            $recurrence = "WEEKENDS";
        }

        $this->attributes["Recurrence"] = $recurrence;

        return $this->save();
    }
47992
public function setValidityPeriod(\DateInterval $validityPeriod = null): self
    {
        if (null !== $validityPeriod &&
            ($validityPeriod->i < ValidityPeriods::MIN || $validityPeriod->i > ValidityPeriods::MAX)
        ) {
            throw new InvalidValidityPeriodException();
        }

        $this->validityPeriod = $validityPeriod;

        return $this;
    }
817359
protected static function intervalHasTime(DateInterval $interval)
    {
        // The array_key_exists and get_object_vars are used as a workaround to check microsecond support.
        // Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug:
        // https://bugs.php.net/bug.php?id=74852
        return $interval->h || $interval->i || $interval->s || array_key_exists('f', get_object_vars($interval)) && $interval->f;
    }
873048
public function everyMinutes($minutes)
    {
        $minutesSchedule = self::ANY;
        if ($minutes != 1) {
            $minutesSchedule .= '/'.$minutes;
        }

        $this->setScheduleMinute($minutesSchedule);

        return $this;
    }
975349
public function setByWeekNo($value)
    {
        if (!is_integer($value) || $value > 53 || $value < -53 || $value === 0) {
            throw new InvalidArgumentException('Invalid value for BYWEEKNO');
        }

        $this->byWeekNo = $value;

        $this->canUseBySetPos = true;

        return $this;
    }
797923
public static function create(array $expressions) : Intervals
    {
        /** @var \Interval\Parser\IntervalsParser $parser */
        $parser = self::loadDi()->get(Di::PARSER_INTERVALS);
        return $parser->parse($expressions);
    }
919601
public function eachWeeks($weeks = 1, \Closure $callback, $onlyFullWeek = false)
    {
        if ($this->lengthInWeeks() > 0) {
            return $this->each(
                new \DateInterval("P{$weeks}W"),
                function (CarbonPeriod $period) use ($weeks, $callback, $onlyFullWeek) {
                    if (!$onlyFullWeek || $period->lengthInWeeks() === $weeks) {
                        call_user_func_array($callback, func_get_args());
                    }
                }
            );
        }

        return $this;
    }
1239719
public function withIntervalInMonths($intervalInMonths)
    {
        $this->validateInterval($intervalInMonths);
        $this->interval = $intervalInMonths;
        $this->intervalUnit = IntervalUnit::MONTH;

        return $this;
    }
187849
public function weekly()
    {
        $this->setScheduleMonth(self::ANY);
        $this->setScheduleWeek(self::ANY);
        $this->setScheduleDayOfMonth(self::ANY);
        $this->setScheduleDayOfWeek(Day::SUNDAY);
        $this->setScheduleHour(0);
        $this->setScheduleMinute(0);

        return $this;
    }
843184
public function add(TimeInterval $interval)
    {
        $date = clone $this->date;
        $int = new DateInterval($interval->intervalSpec());
        $date->add($int);
        return $this->dateTimeToTimePoint($date);
    }
93428
public final function addWeeks( int $weeks = 1 )
      : DateTime
   {

      return $this->move( new \DateInterval( 'P' . \abs( $weeks ) . 'W' ), $weeks < 0 );

   }
272991
public function add(\DateInterval $interval)
    {
        $this->startDate->add($interval);
        $this->endDate->add($interval);

        return $this;
    }