Сбрасывает значение в цепочки ключей.
@param array $keys цепочка ключей
@param array $source контейнер
@throws InvalidArgumentException
@throws UnexpectedValueException
976763
private function resetByPath(array $keys, array &$source)
    {
        if ($keys) {
            $key = array_shift($keys);

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

            $value = & $source[$key];
        } else {
            $value = & $source;
        }

        if (!$keys) {
            if (is_array($value)) {
                $input = & $value;
            } else {
                $input = [&$value];
            }

            array_walk_recursive(
                $input,
                function (&$val) {
                    if ($val instanceof IConfigValue) {
                        $val->reset();
                    } elseif ($val instanceof IConfig) {
                        $val->reset();
                    } else {
                        throw new UnexpectedValueException($this->translate(
                            'Config source is corrupted.'
                        ));
                    }
                }
            );
        } else {
            if ($value instanceof IConfig) {
                $value->reset(implode(self::PATH_SEPARATOR, $keys));
            } elseif (is_array($value)) {
                $this->resetByPath($keys, $value);
            } else {
                throw new InvalidArgumentException($this->translate(
                    "Trying to reset sub key for scalar value."
                ));
            }
        }
    }
1144839
public function deleteIndex($keys)
    {
        if (is_string($keys)) {
            $indexName = $keys;
            if (! preg_match('#_-?1$#', $indexName)) {
                $indexName .= '_1';
            }
        } elseif (is_array($keys)) {
            $indexName = \MongoDB\generate_index_name($keys);
        } else {
            throw new \InvalidArgumentException();
        }

        try {
            return TypeConverter::toLegacy($this->collection->dropIndex($indexName));
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            return ExceptionConverter::toResultArray($e) + ['nIndexesWas' => count($this->getIndexInfo())];
        }
    }
1195645
public static function sets($keys, $createdBy = null)
    {
        if (!is_array($keys)) {
            return false;
        }
        foreach ($keys as $key => $value) {
            static::set($key, $value, $createdBy);
        }
    }
326872
protected function addItem(string $key, array $values): void
    {
        if (!array_key_exists('source', $values) || !array_key_exists('target', $values)) {
            throw new \InvalidArgumentException('Invalid translation array: ' . var_export($values, true));
        }

        $this->translationBuffer[$key] = new MemoryTranslationValue($key, $values['source'], $values['target']);
    }
226329
public function setValues($values)
    {
        if ((null !== $values) && (false === is_array($values))) {
            if (false === ($values instanceof ArrayAccess)) {
                throw new InvalidArgumentException(
                    'The value of $values is not an array or an instance of ArrayAccess.'
                );
            }
        }

        $this->values = $values;
    }
1011388
public function setArray($key, array $values)
	{
		$this->validateKey($key);
		if (empty($values)) {
			throw new \InvalidArgumentException("Missing value.");
		}
		foreach ($values as $v) {
			$this->validateValue($v);
		}
		$this->params[$key] = [];
		foreach ($values as $v) {
			$this->params[$key][] = $v;
		}
		return $this;
	}
354759
public function setValue($data, $keys, $value)
    {
        if ($this->isKeysEmpty($keys)) {
            return $data;
        }
        if (!is_array($keys)) {
            $keys = [$keys];
        }

        $accessor = new Accessor($data);
        $depth    = 0;
        $keyCount = count($keys);
        foreach ($keys as $key) {
            if ($depth + 1 === $keyCount) {
                if ($accessor->set($key, $value) === false) {
                    throw new InvalidArgumentException(sprintf(
                        'Did not set path %s in structure %s',
                        json_encode($keys),
                        json_encode($data)
                    ));
                }
            } elseif ($accessor->to($key) === false) {
                throw new InvalidArgumentException(sprintf(
                    'Did not find path %s in structure %s',
                    json_encode($keys),
                    json_encode($data)
                ));
            }

            ++$depth;
        }

        return $accessor->getData();
    }
670990
public function sort($key, $order)
    {
        if ($key == 'key') {
            if ($order == 'asc') {
                ksort($this->db, SORT_NATURAL);
            } else {
                krsort($this->db, SORT_NATURAL);
            }
        } else {
            uasort($this->db, function ($a, $b) use ($order) {
                if (!is_scalar($a) || !is_scalar($b)) {
                    throw new InvalidArgumentException('Cannot not sort non-scalar values');
                }

                return $order == 'asc' ? strnatcasecmp($a, $b) : -strnatcasecmp($a, $b);
            });
        }
    }
594256
private function arrayHasKeys(array $input, array $keys)
    {
        foreach ($keys as $key) {
            if (!array_key_exists($key, $input)) {
                throw new \InvalidArgumentException(sprintf(
                    'Input missing required one or more required keys. Required keys are %s',
                    implode(', ', $keys)
                ));
            }
        }
    }
846227
public function setConfig(array $configs)
	{
		foreach($configs as $config_key => $config_value)
		{
			if( property_exists(get_class($this), $config_key) )
			{
				$this->$config_key = $config_value;
			}
			else
			{
				throw new \InvalidArgumentException;
			}
		}
	}
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);
    }
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);
    }
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];
    }
89220
public static function updateRecord($primaryKey, $fieldValues)
    {
        if (!is_scalar($primaryKey)) {
            throw new InvalidArgumentException(['`:value` is not a valid primary key value', 'value' => $primaryKey]);
        }

        $instance = new static();
        return static::query()->whereEq($instance->getPrimaryKey(), $primaryKey)->update($fieldValues);
    }
1297320
public static function validateMultiple($keys)
    {
        foreach ($keys as $key) {
            if (!is_string($key) && !is_int($key)) {
                throw InvalidKeyException::forKey($key);
            }
        }
    }
1339594
public function setSource($source)
    {
        if (Format::isIdentifier($source)) {
            $this->source = $source;
        } else {
            $msg = "'${source}' is not a valid QTI identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
1004724
public function setSource($source)
    {
        if ($source !== null && !\Erebot\Utils::stringifiable($source)) {
            throw new \Erebot\InvalidValueException('Not a valid nickname');
        }

        $this->source = $source;
    }