Sets the opening intervals.

@param array $openingIntervals

@throws \InvalidArgumentException If no days are passed or invalid interval is passed
186857
protected function setOpeningIntervals(array $openingIntervals)
    {
        if (empty($openingIntervals)) {
            throw new \InvalidArgumentException('The day must have at least one opening interval.');
        }

        $this->openingIntervals = [];

        foreach ($openingIntervals as $openingInterval) {
            if (!is_array($openingInterval) || !isset($openingInterval[0]) || !isset($openingInterval[1])) {
                throw new \InvalidArgumentException(
                    'Each interval must be an array containing opening and closing times.'
                );
            }

            $this->openingIntervals[] = TimeInterval::fromString($openingInterval[0], $openingInterval[1]);
        }

        usort($this->openingIntervals, function (TimeInterval $a, TimeInterval $b) {
            return ($a->getStart() > $b->getStart()) ? 1 : -1;
        });
    }
885807
public function setObjects($objects)
    {
        if (!is_array($objects)) {
            $objects = [$objects];
        }

        $this->objects = [];
        foreach ($objects as $object) {
            if (is_string($object)) {
                $vObj = Reader::read($object);
                if (!$vObj instanceof Component\VCard) {
                    throw new \InvalidArgumentException('String could not be parsed as \\Sabre\\VObject\\Component\\VCard by setObjects');
                }

                $this->objects[] = $vObj;
            } elseif ($object instanceof Component\VCard) {
                $this->objects[] = $object;
            } else {
                throw new \InvalidArgumentException('You can only pass strings or \\Sabre\\VObject\\Component\\VCard arguments to setObjects');
            }
        }
    }
1101729
public static function toSecondsUsingDays(\DateInterval $interval)
    {
        $seconds = (string) $interval->s;

        if ($interval->i) {
            $seconds = bcadd($seconds, bcmul($interval->i, self::SECONDS_MINUTE));
        }

        if ($interval->h) {
            $seconds = bcadd($seconds, bcmul($interval->h, self::SECONDS_HOUR));
        }

        if ((false !== $interval->days) && (0 <= $interval->days)) {
            $seconds = bcadd($seconds, bcmul($interval->days, self::SECONDS_DAY));
        } else {
            throw new InvalidArgumentException(
                'The "days" property is not set.'
            );
        }

        return $seconds;
    }
619083
public function set(int $offset, Period $interval): void
    {
        $this->get($offset);
        $this->intervals[$offset] = $interval;
    }
394328
public function withIntervalInSeconds($intervalInSeconds)
    {
        $this->validateInterval($intervalInSeconds);

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

        return $this;
    }
1107561
protected function setDayOfWeek($dayOfWeek)
    {
        if (!in_array($dayOfWeek, Days::toArray())) {
            throw new \InvalidArgumentException(sprintf('Invalid day of week "%s".', $dayOfWeek));
        }

        $this->dayOfWeek = $dayOfWeek;
    }
1294713
public function setAttributes($values){

        if(is_array($values)){
            foreach($values as $name => $value){
                $this->setAttribute($name, $value);
            }
        }else{
            throw new InvalidArgumentException('"values" must be an array');
        }

    }
1256303
public function setRuntimeServices($runtimeServices)
    {
        if (!in_array(gettype($runtimeServices), ['array', 'object'])) {
            throw new \InvalidArgumentException("The service provider list must be an array or an object, given " . gettype($runtimeServices));
        }

        $this->runtimeServices = array_merge($this->runtimeServices, (new Model($runtimeServices))->toArray());
    }
601647
public void setPeriod(ReadableInterval interval) {
        if (interval == null) {
            setPeriod(0L);
        } else {
            Chronology chrono = DateTimeUtils.getChronology(interval.getChronology());
            setPeriod(interval.getStartMillis(), interval.getEndMillis(), chrono);
        }
    }
876898
protected function setAndVerify($value, $interval)
    {
        if (!filter_var($value, FILTER_VALIDATE_INT) && $value != '0') {
            throw new InvalidArgumentException(sprintf("The %s should be an integer.", $interval));
        }
        $this->$interval = $value;
    }
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);
    }
727608
public function setExpirationInterval($expiration_interval)
    {
        $allowedValues = $this->getExpirationIntervalAllowableValues();
        if (!is_null($expiration_interval) && !in_array($expiration_interval, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'expiration_interval', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['expiration_interval'] = $expiration_interval;

        return $this;
    }
520862
public function setParams($params): void
    {
        if (! \is_array($params) && ! $params instanceof \ArrayAccess) {
            throw new \InvalidArgumentException('Event params are invalid. Expected type is array or \\ArrayAccess. Got ' . \gettype($params));
        }

        $this->params = $params;
    }
986889
public function setMinLevel(string $level): void
    {
        if ($this->levelIsValid($level) === false) {
            throw new \InvalidArgumentException('Invalid log-level provided.');
        }
        $this->minLevel = $this->getLevelCode($level);
    }
767836
public function setInterval($interval)
    {
        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker interval after worker has started working');
        }

        $this->interval = $interval;
    }
369207
public function setByMonthDay($day)
    {
        if (!is_integer($day) || $day > 31 || $day < -31 || $day === 0) {
            throw new InvalidArgumentException('Invalid value for BYMONTHDAY');
        }

        $this->byMonthDay = $day;

        $this->canUseBySetPos = true;

        return $this;
    }
611742
public function start($name)
    {
        if (\in_array($name, $this->openSlots)) {
            throw new \InvalidArgumentException(sprintf('A slot named "%s" is already started.', $name));
        }

        $this->openSlots[] = $name;
        $this->slots[$name] = '';

        ob_start();
        ob_implicit_flush(0);
    }