Sets the protocol level.

@param int $value

@throws \InvalidArgumentException
3471
public function setProtocolLevel($value)
    {
        if ($value < 3 || $value > 4) {
            throw new \InvalidArgumentException(sprintf('Unknown protocol level %d.', $value));
        }

        $this->protocolLevel = $value;
        if ($this->protocolLevel === 3) {
            $this->protocolName = 'MQIsdp';
        } elseif ($this->protocolLevel === 4) {
            $this->protocolName = 'MQTT';
        }
    }
322106
public function unserialize($value)
    {
        if ($value === null || is_scalar($value)) {
            $this->str = unserialize($value);
        } else {
            throw new \InvalidArgumentException(sprintf('HString cannot unserialize a %s', Helper::getType($value)));
        }
    }
1262954
public static function set(string $key, $value)
    {
        if (!in_array($key, self::$allowedKeys)) {
            throw new \InvalidArgumentException('Invalid key given');
        }

        self::$storedValues[$key] = $value;
    }
524104
public function offsetSet( $offset, $value )
	{
		if( $this instanceof TypeOfInterface && ! $this->typeOf($value, $offset) )
		{
			throw new \InvalidArgumentException("Invalid data type for offset item");
		}

		if (is_null($offset))
		{
			$this->items[] = $value;
		}
		else
		{
			$this->items[$offset] = $value;
		}
	}
238018
public function setValue($value)
    {
        if (is_int($value) || is_float($value)) {
            $this->value = $value;
        } else {
            $msg = "The value of a Weight must be a valid integer or float value, '" . gettype($value) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1071340
public function offsetSet($offset, $value)
    {
        if (!(is_integer($offset) && $offset >= 0 && $offset <= $this->count()))
        {
            throw new \InvalidArgumentException('The offset must be a valid, positive integer.');
        }

        if (!$value instanceof Token)
        {
            throw new \InvalidArgumentException('The value provided must be a token.');
        }

        $this->tokens[$offset] = $value;
    }
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;
    }
376790
public function setOption($option, $value)
    {
        switch ($option) {
        case 'keep-alive':
        case 'ssl':
            $this->options[$option] = (bool) $value;
            break;

        case 'http-log':
        case 'headers':
        case 'password':
        case 'username':
            $this->options[$option] = $value;
            break;

        default:
            throw new \InvalidArgumentException("Unknown option $option.");
        }
    }
11431
public function setZoom($value)
	{
		if (!is_numeric($value)) {
			throw new MapperArgumentException('Zoom level must be an integer.');
		}

		if ($value < 1 || $value > 20) {
			throw new MapperArgumentException('A zoom level must be between 1 and 20.');
		}

		$this->zoom = $value;
	}
1039805
public function setValue($value)
    {
        // If we're getting the data from json, we'll be receiving an object
        if ($value instanceof \StdClass) {
            $value = (array) $value;
        }

        if (is_array($value)) {
            $newVal = [];
            foreach ($value as $k => $v) {
                if (is_string($v)) {
                    $v = strtoupper($v);

                    // The value had multiple sub-values
                    if (false !== strpos($v, ',')) {
                        $v = explode(',', $v);
                    }
                    if (0 === strcmp($k, 'until')) {
                        $v = strtr($v, [':' => '', '-' => '']);
                    }
                } elseif (is_array($v)) {
                    $v = array_map('strtoupper', $v);
                }

                $newVal[strtoupper($k)] = $v;
            }
            $this->value = $newVal;
        } elseif (is_string($value)) {
            $this->value = self::stringToArray($value);
        } else {
            throw new \InvalidArgumentException('You must either pass a string, or a key=>value array');
        }
    }
1258086
public function setAccountId($value)
    {
        if ($value === null || $value === '') {
            $this->_accountId = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_accountId = (string)$value;
        } else {
            throw new \InvalidArgumentException('Invalid account_id value type "' . gettype($value) . '"');
        }
    }
836787
public function setGatewayId($value)
    {
        if ($value === null || $value === '') {
            $this->_gatewayId = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_gatewayId = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException(
                'Invalid gatewayId value type in RefundsRequest', 0, 'RefundsRequest.gatewayId', $value
            );
        }
    }
270246
public function setValue($value)
    {
        if (\is_string($value)) {
            $this->value = $value;
        } elseif (\is_object($value) && $value instanceof self) {
            $this->value = $value->getValue();
        }

        throw new \InvalidArgumentException('Expected string');
    }
488794
public static function set($option, $value)
    {
        if (!array_key_exists($option, self::$conf))
        {
            throw new InvalidArgumentException(sprintf('Unknown option "%s"', $option));
        }

        $expected = gettype(self::$conf[$option]);
        $actual = gettype($value);
        if ($expected != $actual)
        {
            throw new InvalidArgumentException(
                sprintf('Option "%s" has type "%s", but "%s" given',
                    $option, $expected, $actual)
            );
        }

        self::$conf[$option] = $value;
    }
782376
public function set($key, $value)
    {
        if (!$value instanceof EmailBodyPart) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s only accepts instances of %s. Tried to to set key %s.',
                    __FUNCTION__, EmailBodyPart::class, $key
                )
            );
        }

        parent::set($key, $value);
    }
780163
public function setId(int $value) : Setting
    {

        if ($this->data['id'] !== $value) {
            $this->data['id'] = $value;
            $this->setModified('id');
        }

        return $this;
    }
389761
public function setSubject($value)
    {
        if (trim($value) == null)
        {
            throw new InvalidArgumentException("Subject cannot be empty.");
        }
        $this->subject = trim($value);
    }