Sets the password.

@param string $value

@throws \InvalidArgumentException
437778
public function setPassword($value)
    {
        $this->assertValidStringLength($value, false);

        $this->password = $value;
        if ($this->password !== '') {
            $this->flags |= 128;
        } else {
            $this->flags &= ~128;
        }
    }
1114180
public function setPassword($password)
    {
        if ($this->isNew() && ($password === null || trim($password) == "")) {
            throw new InvalidArgumentException("customer password is mandatory on creation");
        }

        if ($password !== null && trim($password) != "") {
            $this->setAlgo("PASSWORD_BCRYPT");

            parent::setPassword(password_hash($password, PASSWORD_BCRYPT));
        }

        return $this;
    }
1147271
public function setPassword($password)
    {
        $this->{$this->passwordHashAttribute} = Yii::$app->security->generatePasswordHash($password);
    }
757674
protected function validate($value)
	{
		if ($value < $this->minValue || $value > $this->maxValue)
		{
			throw new InvalidArgumentException('Value ' . $value . ' is out of bounds (' . $this->minValue . '..' . $this->maxValue . ')');
		}
	}
434501
protected function guard($value)
    {
        $languageName = Intl::getLanguageBundle()->getLanguageName($value);

        if (null === $languageName) {
            throw new InvalidLanguageCodeException($value);
        }
    }
829380
public function remove($value)
    {
        if (false === ($index = array_search($value, $this->data, true))) {
            throw new \InvalidArgumentException('index out of bounds');
        }

        $this->pop($index);
    }
567946
public function setStrict($value)
    {
        if (!is_bool($value)) {
            throw new OneLogin_Saml2_Error(
                'Invalid value passed to setStrict()',
                OneLogin_Saml2_Error::SETTINGS_INVALID_SYNTAX
            );
        }

        $this->_settings->setStrict($value);
    }
904386
public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new \InvalidArgumentException('Expected string as key');
        }

        if (!is_string($value)) {
            throw new \InvalidArgumentException('Expected string as value');
        }

        $queryString = 'REPLACE INTO ' . $this->name . ' VALUES (:key, :value);';
        $stmt = $this->db->prepare($queryString);
        $stmt->bindParam(':key', $key, \PDO::PARAM_STR);
        $stmt->bindParam(':value', $value, \PDO::PARAM_STR);
        $stmt->execute();
        $this->data[(string)$key] = $value;

        return $this->data[$key];
    }
846700
protected function _set($key, $value)
    {
        if (!is_string($key)) {
            throw new Exception\InvalidArgumentException(
                "Key must be a string or a number: '$key' given"
            );
        }
        $this->_data[$key] = $value;
    }
1266726
public function setGatewayId($value)
    {
        if ($value === null || $value === '') {
            $this->_gatewayId = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_gatewayId = (string)$value;
        } else {
            throw new \InvalidArgumentException('Invalid gateway_id value type "' . gettype($value) . '"');
        }
    }
1183006
protected function setValue($value)
    {
        if (!$this->validate($value)) {
            throw new \InvalidArgumentException(sprintf('%s is not a valid value', $value));
        }

        $this->value = $value;
    }
1235249
public function offsetSet($offset, $value)
    {
        if (!$value instanceof Token) {
            throw new \InvalidArgumentException('Value must be of type Token.');
        }

        if ($offset === null) {
            $this->tokens[] = $value;

            return;
        }

        $this->tokens[$offset] = $value;
    }
46518
public function setValue($value, $data = null)
    {
        // If $data is a DataObject, don't use the value, since it's a hashed value
        if ($data && $data instanceof DataObject) {
            $value = '';
        }

        //store this for later
        $oldValue = $this->value;

        if (is_array($value)) {
            $this->value = $value['_Password'];
            $this->confirmValue = $value['_ConfirmPassword'];
            $this->currentPasswordValue = ($this->getRequireExistingPassword() && isset($value['_CurrentPassword']))
                ? $value['_CurrentPassword']
                : null;

            if ($this->showOnClick && isset($value['_PasswordFieldVisible'])) {
                $this->getChildren()->fieldByName($this->getName() . '[_PasswordFieldVisible]')
                    ->setValue($value['_PasswordFieldVisible']);
            }
        } else {
            if ($value || (!$value && $this->canBeEmpty)) {
                $this->value = $value;
                $this->confirmValue = $value;
            }
        }

        //looking up field by name is expensive, so lets check it needs to change
        if ($oldValue != $this->value) {
            $this->getChildren()->fieldByName($this->getName() . '[_Password]')
                ->setValue($this->value);

            $this->getChildren()->fieldByName($this->getName() . '[_ConfirmPassword]')
                ->setValue($this->confirmValue);
        }

        return $this;
    }
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';
        }
    }
1077635
protected function setValue($value)
    {
        if (!is_int($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be an integer", static::prototype());
        }
        $this->value = $value;
    }
135759
public function setValue($value)
    {
        if ((\is_bool($value))) {
            $this->value = (bool) $value;
        } elseif (\is_object($value) && $value instanceof self) {
            $this->value = $value->getValue();
        } else {
            throw new \InvalidArgumentException('Expected boolean');
        }
    }
170429
protected function setValue($value)
    {
        if (!is_string($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a string", static::prototype());
        }

        if(!mb_check_encoding($value, 'UTF-8')) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a UTF-8 encoded", static::prototype());
        }

        $this->value = $value;
    }