Tells whether the given interval is present in the sequence.

@param Period ...$intervals
962001
public function contains(Period $interval, Period ...$intervals): bool
    {
        $intervals[] = $interval;
        foreach ($intervals as $period) {
            if (false === $this->indexOf($period)) {
                return false;
            }
        }

        return true;
    }
183247
public function setUpdateCheck($interval)
    {
        $validIntervals = [
            Checker::ALWAYS,
            Checker::DAILY,
            Checker::WEEKLY,
            Checker::MONTHLY,
            Checker::NEVER,
        ];

        if (!\in_array($interval, $validIntervals)) {
            throw new \InvalidArgumentException('invalid update check interval: ' . $interval);
        }

        $this->updateCheck = $interval;
    }
598233
public function run($interval = self::CHECK_INTERVAL)
    {
        $this->start();

        $sleep = (int) ($interval * 1000000);
        while ($this->poll()) {
            usleep($sleep);
        }

        return $this->isSuccessful();
    }
362535
public function withIntervalInYears($intervalInYears)
    {
        $this->validateInterval($intervalInYears);
        $this->interval = $intervalInYears;
        $this->intervalUnit = IntervalUnit::YEAR;

        return $this;
    }
765799
public function offsetSet($offset, $interval): void
    {
        if (null !== $offset) {
            $this->set($offset, $interval);
            return;
        }

        $this->push($interval);
    }
385099
public function equals(PeriodInterface $period)
    {
        return
            $period instanceof static &&
            $this->begin->format('Y-m-d-H-i-s') === $period->getBegin()->format('Y-m-d-H-i-s')
        ;
    }
535719
protected function set_period(int $period):void{

		if($period < 15 || $period > 60){
			throw new AuthenticatorException('Invalid period: '.$period);
		}

		$this->period = $period;
	}
245945
public function period(string $period)
    {
        if (!in_array($period, Constants::PERIODS)) {
            throw new InvalidPeriodException('Request period is not valid. Valid values are defined in \Barryvanveen\Lastfm\Constants::PERIODS.');
        }

        $this->query = array_merge($this->query ?? [], ['period' => $period]);

        return $this;
    }
882000
public boolean contains(ChronoInterval<T> interval) {

        for (ChronoInterval<T> i : this.intervals) {
            if (i.equals(interval)) {
                return true;
            }
        }

        return false;

    }
573472
protected function center(array $intervals)
    {
        usort($intervals, function (RangeInterface $a, RangeInterface $b) {
            return $this->compare(
                $a->getStart(),
                $b->getStart()
            );
        });

        return $intervals[count($intervals) >> 1]->getStart();
    }
731474
public function remove(int $offset): Period
    {
        $interval = $this->get($offset);
        unset($this->intervals[$offset]);

        $this->intervals = array_values($this->intervals);

        return $interval;
    }
41503
public function spans($time_period)
    {
        $time_period = self::parseTimePeriod($time_period);

        // If the date range does not have a bound then it will not span any time periods.
        if (! $this->isBounded()) {
            return false;
        }

        // After must be positioned at the end of the time period
        $end = self::forTimePeriod($time_period, $this->after)->end();
        if (! $end->eq($this->after)) {
            return;
        }

        // Before must be positioned at the start of the time period
        $start = self::forTimePeriod($time_period, $this->before)->start();
        if (! $start->eq($this->before)) {
            return;
        }

        // The start of the date range should equal the end of the date range set back to the start of its time period.
        // This ensures that the range spans only a single time period; otherwise if we only checked the bounds, they
        // could be two or more time periods apart.
        if (! self::forTimePeriod($time_period, $this->end())->start()->eq($this->start())) {
            return;
        }

        return $this->start();
    }
341735
public function withIntervalInMinutes($intervalInMinutes)
    {
        $this->validateInterval($intervalInMinutes);
        $this->interval = $intervalInMinutes;
        $this->intervalUnit = IntervalUnit::MINUTE;

        return $this;
    }
332016
public function isWithinFrequency($hour, $frequencies, $hours)
    {
        $hourIndex = $this->getIndex($hour, $hours);
        foreach ($frequencies as $frequency) {
            $startIndex = $this->getIndex(date('G', $frequency->getStartTime()->getTimestamp()), $hours);
            $endIndex = $this->getIndex(date('G', $frequency->getEndTime()->getTimestamp()), $hours);
            if ($hourIndex >= $startIndex && $hourIndex <= $endIndex) {
                return true;
            }
        }

        return false;
    }
619083
public function set(int $offset, Period $interval): void
    {
        $this->get($offset);
        $this->intervals[$offset] = $interval;
    }
1138768
protected function dateIntervalToSeconds($interval): int
    {
        $now = time();
        $dt = new \DateTime();
        $dt->add($interval);
        $ts = $dt->getTimestamp();
        $diff = $ts - $now;
        return $diff;
    }
1331236
public boolean containsInterval(Interval<T> i) {

        for (Interval<T> item : intervals) {
            if (item.contains(i)) {
                return true;
            }
        }

        return false;
    }