@param string $key
@param mixed  $value

@return Log
@throws \InvalidArgumentException
5155
public function with( $key, $value ) {

		if ( ! is_string( $key ) || ! array_key_exists( $key, self::$filters ) ) {
			throw new \InvalidArgumentException( 'Invalid Log key.' );
		}

		return $this->merge_array( [ $key => $value ] );
	}
914261
protected function getCallable($value, $key)
    {
        // If the value is a string, a registrar is set and the value is
        // registred with the registrar, resolve it there.
        if (
            is_string($value) &&
            $this->hasRegistrar() &&
            $this->registrar->isRegistred($value)
        ) {
            $value = $this->registrar->resolve($value);
        }

        // If the value is now a callable, go ahead and return it...
        if (is_callable($value)) {
            return $value;
        }

        // However, if we've got an object and a filter method for the key
        // exists, we'll return that as a callable.
        if (
            is_object($value) &&
            method_exists($value, $method = $this->getFilterMethodName($key))
        ) {
            return [$value, $method];
        }

        throw new InvalidArgumentException(sprintf(
            'Could not resolve callable for [%s]', $value
        ));
    }
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;
    }
412237
public function set($key, $value = null)
    {
        if (isset($value)) {
            $this->building[$key] = $value;
            return $this;
        }

        return new static($this->getSetCallback($key));
    }
472480
public function set($key, $value)
    {
        if (! $value instanceof EntityMapperInterface) {
            throw new InvalidArgumentException(
                'Trying to add a non EntityMapper to MappersMap.'
            );
        }
        return parent::set($key, $value);
    }
489708
public function setLogDate($value) : Log
    {
        $this->validateDate('LogDate', $value);

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

        return $this;
    }
33400
protected function filter($key, $value, $arg)
    {
        if (!is_string($value)) {
            throw new \InvalidArgumentException(htmlspecialchars(
                "The $key field does not exist"
            ));
        }

        return htmlspecialchars($value);
    }
841568
function set($key, $value) {
        if(\is_array($key) || \is_object($key)) {
            throw new \InvalidArgumentException('Key can not be an array or object');
        }
        
        $key = (string) $key;
        return parent::set($key, $value);
    }
839596
public function setExpression($value)
    {
        $this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
        if (count($this->cronParts) < 6) {
            throw new InvalidArgumentException(
                $value . ' is not a valid CRON expression'
            );
        }

        foreach ($this->cronParts as $position => $part) {
            $this->setPart($position, $part);
        }

        return $this;
    }
470713
public function set( $key, $value ) {
		$key = $this->addKeyprefixIfNeeded( $key );
		$this->params[$key] = $value;
		return $this;
	}
112245
public function set($key, $value)
    {
        if (is_array($key) && $value === null)
            $args = $key;
        else
            $args = func_get_args();

        $value = array_pop($args);
        
        $parent = null;
        $key = null;
        $ref = &$this->values;
        foreach ($args as $arg)
        {
            if (!is_scalar($arg))
                throw new \InvalidArgumentException("Keys must be scalar, not: " . WF::str($arg));

            if (!is_array($ref))
            {
                if ($parent !== null)
                    $parent[$key] = array();
                $ref = &$parent[$key];
            }
                
            if (!isset($ref[$arg]))
                $ref[$arg] = array();

            $parent = &$ref;
            $key = $arg;
            $ref = &$ref[$arg];
        }

        // Unwrap Dictionary objects
        $cl = is_object($value) ? get_class($value) : null;
        if ($cl === Dictionary::class)
            $ref = $value->getAll();
        else
            $ref = $value;

        return $this;
    }
622546
protected function get($key, $value = false)
    {
        if (is_null($key)) {
            throw new \InvalidArgumentException('Null argument passed to '.__METHOD__);
        }

        $config = [];
        $config = static::$config;

        if (empty($config)) {
            throw new \Exception('Config stack is empty!');
        }

        if ($value == false && array_key_exists($key, $config)) {
            return isset($config[$key]) ? $config[$key] : null;
        }

        if (array_key_exists($key, $config) && $value == true) {
            return $config[$key][$value];
        }

        /*
         | We will access array value as string with dot separator
         | 'module.config' => [
         |    "config"  => [
         |        "name" => "Welcome To Module"
         |    ]
         | ]
         | Config::get('module-config.config.name');
         */
        return ArrayAccessor::make($config, function ($a) use ($key) {
            return $a->toString($key);
        });
    }
1338788
public function setValue($value) {
		if(!in_array($value, self::VALID_VALUES)) {
			throw new InvalidArgumentException('Value is not valid.');
		}

		$this->value = $value;

		return $this;
	}
506420
public function set(string $group, string $key, $value): ArrayCache
    {
        if ($group === "") {
            throw new \InvalidArgumentException(
                "invalid group provided; expecting a non empty string"
            );
        }

        if ($key === "") {
            throw new \InvalidArgumentException(
                "invalid key provided; expecting a non empty string"
            );
        }

        if ($value === null) {
            throw new \InvalidArgumentException(
                "invalid value provided; expecting anything but null"
            );
        }

        if (!isset($this->values[$group])) {
            $this->values[$group] = [];
        }

        $this->values[$group][$key] = $value;
        return $this;
    }
486328
public static function toByteString($value)
    {
        if (self::isStringCastable($value)) {
            return (string)$value;
        } else {
            throw new \InvalidArgumentException(ErrorMessageCreator::create($value, 'ByteString (a string)'));
        }
    }
239617
public function put(string $key, $value): self
    {
        if (!is_scalar($value)) {
            throw new \InvalidArgumentException(
                    'Argument 2 passed to ' . __METHOD__
                    . ' must be an instance of a scalar value.'
            );
        }

        $this->headers[$key] = (string) $value;
        return $this;
    }
277977
public function add($key, $value)
    {
        if (is_numeric($key)) {
            throw new \InvalidArgumentException('Key must not be a number.');
        }

        $this->data[$key] = $value;
    }