Удаляет значение по заданной цепочке ключей.
@param array $keys цепочка ключей
@param array $source контейнер
@throws UnexpectedValueException
@throws InvalidArgumentException
333535
private function deleteByPath(array $keys, array &$source)
    {
        $key = array_shift($keys);

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

        $value = & $source[$key];

        if (!$keys) {
            if (($value instanceof IConfig) || is_array($value)) {
                // todo: is it right?
                throw new UnexpectedValueException($this->translate(
                    'Cannot delete array of values.'
                ));
            } elseif ($value instanceof IConfigValue) {
                $value->del();
            } else {
                throw new UnexpectedValueException($this->translate(
                    'Config source is corrupted.'
                ));
            }
        } else {
            if ($value instanceof IConfig) {
                $value->del(implode(self::PATH_SEPARATOR, $keys));
            } elseif (is_array($value)) {
                $this->deleteByPath($keys, $value);
            } else {
                throw new InvalidArgumentException($this->translate(
                    "Trying to delete sub key for scalar value."
                ));
            }
        }
    }
1236349
public function mset(array $fields, array $values)
    {
        // Those are really temporary tricks.
        // @todo: Rewrite it to use native Predis API
        if(count($fields) !== count($values))
        {
            throw new \InvalidArgumentException(
                "Fields and values array have to be equal!"
            );
        }

        $combined = array_combine($fields, $values);

        foreach ($combined as $field => $value) {
            $this->set($field, $value);
        }
    }
194849
public function setSourceValue($sourceValue)
    {
        if (is_int($sourceValue)) {
            $this->sourceValue = $sourceValue;
        } else {
            $msg = "SourceValue must be an integer, '" . gettype($sourceValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
535250
public function getValue(array $keys, $default = null)
    {
        $config = $this->config;
        $pointer = &$config;
        foreach ($keys as $key) {
            if (!array_key_exists($key, $pointer)) {
                if ($default === null) {
                    throw new InvalidArgumentException(sprintf(
                        'Key "%s" does not exist',
                        implode('.', $keys)
                    ));
                }
                return $default;
            }
            $pointer = &$pointer[$key];
        }
        return $pointer;
    }
298090
public function forget($keys)
    {
        $remove  = $keys;

        foreach($remove as $key){
            $this->unsetValue($key);
        }

    }
182669
public function _delete(...$keyValues) {
		$instance = DAO::getOne ( $this->model, $keyValues, false );
		$this->operate_ ( $instance, function ($instance) {
			return DAO::remove ( $instance );
		}, "deleted", "Unable to delete the instance", $keyValues );
	}
826449
public function setShardKey(array $keys, array $options = []) : void
    {
        if ($this->inheritanceType === self::INHERITANCE_TYPE_SINGLE_COLLECTION && $this->shardKey !== []) {
            throw MappingException::shardKeyInSingleCollInheritanceSubclass($this->getName());
        }

        if ($this->isEmbeddedDocument) {
            throw MappingException::embeddedDocumentCantHaveShardKey($this->getName());
        }

        foreach (array_keys($keys) as $field) {
            if (! isset($this->fieldMappings[$field])) {
                continue;
            }

            if (in_array($this->fieldMappings[$field]['type'], ['many', 'collection'])) {
                throw MappingException::noMultiKeyShardKeys($this->getName(), $field);
            }

            if ($this->fieldMappings[$field]['strategy'] !== static::STORAGE_STRATEGY_SET) {
                throw MappingException::onlySetStrategyAllowedInShardKey($this->getName(), $field);
            }
        }

        $this->shardKey = [
            'keys' => array_map(static function ($value) {
                if ($value === 1 || $value === -1) {
                    return $value;
                }
                if (is_string($value)) {
                    $lower = strtolower($value);
                    if ($lower === 'asc') {
                        return 1;
                    }

                    if ($lower === 'desc') {
                        return -1;
                    }
                }
                return $value;
            }, $keys),
            'options' => $options,
        ];
    }
1209848
protected function castToArray($source)
    {
        if (is_array($source)) {
            return $source;
        }

        if (!$source instanceof Traversable) {
            throw new UnexpectedValueException('Source has to be \Traversable, array, string or int');
        }

        $array = [];

        foreach ($source as $key => $item) {
            $array[$key] = $item;
        }

        return $array;
    }
1228586
public function merge( $source, $noNullOverwrite = true )
    {
        if ( !is_array( $source ) && !( $source instanceof \Traversable ) )
        {
            throw new \InvalidArgumentException( 'The source must be an array or an object.' );
        }

        foreach ( $source as $_key => $_value )
        {
            if ( null === $_value && true === $noNullOverwrite && Utility\Option::contains( $this->_bag, $_key ) )
            {
                //	If there is a value in the bag, and inbound value is null, skip...
                if ( null !== Utility\Option::get( $this->_bag, $_key ) )
                {
                    continue;
                }
            }

            Utility\Option::set( $this->_bag, $_key, $_value );
        }

        return $this;
    }
1264148
public static final function except(array $Source, $keys){
		return array_diff_key($Source,
			array_fill_keys(self::simplify(array_slice(func_get_args(), 1)), -1));
	}
151712
public final static function clear(string $source, $keys): string {
		return self::encode(Arr::clear(self::decode($source),
			...array_slice(func_get_args(), 1)));
	}
489515
public function deleteMultiple($keys)
    {
        if (!is_array($keys)) {
            throw new InvalidArgumentException(sprintf('Cache keys must be array, "%s" given', is_object($keys) ? get_class($keys) : gettype($keys)));
        }

        return $this->mem->deleteMulti($keys);
    }
1103044
public function set($key, $value)
    {
        $result = $this->allowed($value);
        if ($this->passes($result)) {
            parent::set($key, $this->normalize($value));
        } else {
            throw new \UnexpectedValueException(sprintf(
                'Value of type "%s" forbidden in this instance of %s',
                gettype($value),
                get_class($this)
            ));
        }
    }
760511
public static function forget( array &$storage, $key )
	{
		$segments = explode('.', $key);

		$key = array_pop($segments);

		// iterate through all of $segments except the last one
		foreach ($segments as $segment) {
			if (!array_key_exists($segment, $storage)) {
				return;
			} else if (!is_array($storage[$segment])) {
				throw new \UnexpectedValueException('Non-array segment encountered');
			}

			$storage =& $storage[$segment];
		}

		unset($storage[$key]);
	}
796946
public function forget($keys)
	{
		if( ! is_array($keys) )
		{
			if( func_num_args() == 1 )
			{
				$this->offsetUnset($keys);
				return $this;
			}
			else
			{
				$keys = func_get_args();
			}
		}

		foreach($keys as $name)
		{
			$this->offsetUnset($name);
		}

		return $this;
	}
1085790
public function deleteMultiple($keys): bool
    {
        if (
            !\is_array($keys)
            &&
            !($keys instanceof \Traversable)
        ) {
            throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true));
        }

        $results = [];
        foreach ((array) $keys as $key) {
            $results[] = $this->delete($key);
        }

        return !\in_array(false, $results, true);
    }
749006
public function set($key, $values, $replace = true)
    {
        if(!is_string($key) && !is_int($key)){
            throw new \InvalidArgumentException('$key expected to be string, got:'.gettype($key));
        }

        if( !is_string($values) && !is_array($values) ){
            throw new \InvalidArgumentException('$key expected to be string or array, got: '.gettype($key));
        }

        $values = array_values((array)$values);

        if (true === $replace || !isset($this->container[$key])) {
            $this->container[$key] = $values;
        } else {
            $this->container[$key] = array_merge($this->container[$key], $values);
        }
    }