Sets the developer key.

@param string $key Developer key.

@return $this

@throws InvalidArgumentException Thrown if the developer key is invalid.
489222
public function setDevKey($key)
    {
        $this->validator->validateDeveloperKey($key);

        $this->devKey = $key;

        return $this;
    }
984395
public function useKeyAsValue($key, $normalize = false)
    {
        if (true !== $normalize && !$this->isValidNodeName($key)) {
            throw new \InvalidArgumentException(sprintf('%s is an invalid node name', $key));
        }

        $this->nodeValueKey = $normalize ? $this->normalizer->normalize($key) : $key;
    }
728885
public function setLngProperty($key)
    {
        if ($key === null) {
            $this->lngProperty = $key;
            return $this;
        }

        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'The "lng_property" must be a string'
            );
        }

        $this->lngProperty = $key;
        return $this;
    }
71743
public function post($key = null)
    {
        if ($key) {

            if (isset($_POST[$key])) {
                return $_POST[$key];
            }

            throw new \InvalidArgumentException(sprintf(
                '%s ist not a valid key for $_POST', $key
            ));

        }

        return $_POST;
    }
1324419
public function key(string $key = null)
    {
        if ($key) {
            $this->field['key'] = $key;

            return $this;
        }

        return $this->field['key'];
    }
873964
private function prepareKey($key)
    {
        if (!preg_match('/^[a-zA-Z0-9_-]+$/', $key)) {
            throw new InvalidArgumentException($key);
        }

        return $this->keyPrefix . strtr($key, '-', '_');
    }
1141916
public function delete($key)
    {
		if (! $key || ! is_string($key)) {
			throw new InvalidArgumentException('Invalid cache key');
		}

		$transientKey = $this->generateTransientKey($key);
		delete_transient($transientKey);
	}
321616
public function setKey($key)
    {
        try {
            $this->blockCipher->setKey($key);
        } catch (CryptException\InvalidArgumentException $e) {
            throw new Exception\InvalidArgumentException($e->getMessage());
        }
        $this->encryption['key'] = $key;
        return $this;
    }
1344339
protected function unlock(string $key)
    {
        if (!isset($this->locks[$key])) {
            throw new InvalidArgumentError('No lock was set on the given key.');
        }

        $awaitable = $this->locks[$key];
        unset($this->locks[$key]);
        $awaitable->resolve();
    }
189225
public function setKey($key)
    {
        parent::setKey($key);

        foreach ($this->getHandlers() as $handler) {
            $handler->setKey($key);
        }

        return $this;
    }
1057496
public function set($key, $value)
    {
        if (!$value instanceof Contact) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s only accepts instances of %s. Tried to to set key %s.',
                    __FUNCTION__, Contact::class, $key
                )
            );
        }

        parent::set($key, $value);
    }
575663
public function get(string $key)
    {
        if (!$this->has($key)) {
            throw new \InvalidArgumentException(\sprintf('The value identified by "%s" does not exist.', $key));
        }

        return $this->values[$key];
    }
755150
public static function get( $key )
	{
		$key	= strtoupper( $key );
		if( self::has( $key ) )
			return constant( $key );
		throw new InvalidArgumentException( 'Constant "'.$key.'" is not set' );
	}
1243026
private function validateKey($key)
    {
        $details = openssl_pkey_get_details($key);

        if (!isset($details['key']) || $details['type'] !== OPENSSL_KEYTYPE_RSA) {
            throw new \InvalidArgumentException('This key is not compatible with RSA signatures');
        }
    }
695447
public function set($key, $object) {
		
		if (! is_object($object)) {
			throw new \InvalidArgumentException("Registry only accepts objects, given: ".gettype($object));
		}
		
		$this->_data[$key] = $object;
		
		return $this;
	}
1272161
public function &__get($key)
    {
        if (!isset($this->stack[$key])) {
            throw new InvalidArgumentException(sprintf('Value "%s" is not defined.', $key));
        }

        $set = isset($this->stack[$key]);

        //return $this->stack[$key];
        $return = $set &&
        is_callable($this->stack[$key]) ?
            $this->stack[$key]($this) :
            $this->stack[$key];

        return $return;
    }
819962
public function setSharedKey($key)
    {
        // If the public key is a file name then convert it to
        // the contents of the file (which should be an RSA public
        // key in PEM format)
        if (file_exists($key)) {
            $this->shared_key = file_get_contents($key);
        } elseif (! empty($key)) {
            $this->shared_key = $key;
        }

        return $this;
    }