@param mixed            $data
@param array|string|int $keys
@param mixed            $value

@return mixed
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();
    }
1124886
public function rPushX($key, $value, ...$values) {
        return $this->send(array_merge(['rpushx', $key], (array) $value, $values));
    }
689408
public function addData($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->data[$k] = $v;
            }
        }
        else if (is_string($key)) {
            $this->data[$key] = $value;
        }
        else {
            throw new \InvalidArgumentException(
                "invalid value provided for 'key'; expecting a key as a ".
                "string or an associative array"
            );
        }
        return $this;
    }
1227199
public function asArray($key = null, $value = null)
    {
        if (!is_null($key))
        {
            Helpers\Validate::table($this->name)->field($key);
        }
        if (!is_null($value))
        {
            Helpers\Validate::table($this->name)->field($value);
        }

        $datas = array();
        if (!$this->resetKeys)
        {
            if (is_null($key) && is_null($value))
            {
                return $this->data;
            }
            else
            {
                foreach ($this->data as $rowKey => $data)
                {
                    $datas[$rowKey] = array();
                    foreach ($data as $row)
                    {
                        if (is_null($key))
                        {
                            $datas[$rowKey][] = $row->{$value};
                        }
                        elseif (is_null($value))
                        {
                            $datas[$rowKey][$row->{$key}] = $row;
                        }
                        else
                        {
                            $datas[$rowKey][$row->{$key}] = $row->{$value};
                        }
                    }
                }
            }
        }
        else
        {
            if (is_null($key) && is_null($value))
            {
                foreach ($this->data as $data)
                {
                    $datas[] = get_object_vars($data);
                }
            }
            else
            {
                foreach ($this->data as $data)
                {
                    if (is_null($key))
                    {
                        $datas[] = $data->{$value};
                    }
                    elseif (is_null($value))
                    {
                        $datas[$data->{$key}] = $data;
                    }
                    else
                    {
                        $datas[$data->{$key}] = $data->{$value};
                    }
                }
            }
        }

        return $datas;
    }
978397
protected function addDataInternal($value, $key) {
        if (null === $value || null === $key) {
            return $this;
        }
        $key = $this->processKey($key);
        if ($this->type === static::TYPE_DEFINED_ONLY && !array_key_exists($key, $this->shared)) {
            return $this;
        }
        return $this->addDataByScenario($value, $key);
    }
973837
public function set($key, $value)
    {
        $keys = explode('.', $key);

        $data = $this->getAll();

        $resource = &$data;
        foreach ($keys as $key) {
            if (!isset($resource[$key]) || !is_array($resource[$key])) {
                $resource[$key] = [];
            }
            $resource = &$resource[$key];
        }
        $resource = $value;

        $this->setAll($data);

        return $this;
    }
906035
public function with($key, $value = null)
    {
        if (is_array($key)) {
            $this->_data = array_merge($this->_data, $key);
        } else {
            $this->_data[$key] = $value;
        }

        return $this;
    }
988631
protected function getValues($data, array $keys) {
        $key = array_shift($keys);

        if (array_contains(['', null], $key)) {
            return [];
        }

        if ($key === ValidationToken::WILDCARD_VALUES) {
            $values = $this->getWildcardValues($data, $keys);
        } else if ($key === ValidationToken::WILDCARD_KEYS) {
            $values = $this->getWildcardKeys($data, $keys);
        } else {
            $values = $this->getRegularValues($data, $key, $keys);
        }

        return $values;
    }
212315
protected function pluck($value, $key, $data)
    {
        if (!is_object($data)) {
            return $data;
        }

        if (method_exists($data, 'pluck') || $data instanceof Model) {
            //laravel 5.3.*
            return $data->pluck($value, $key);
        } elseif (method_exists($data, 'lists')) {
            //laravel 5.2.*
            return $data->lists($value, $key);
        }
    }
736423
public static function data($key, $value)
    {
        if ($value === null) {
            unset(self::$shared[$key]);
        } else {
            self::$shared[$key] = $value;
        }
    }
1074055
public function setIn($keys, $value)
    {
        $lastKey = array_shift($keys);
        if (count($keys) > 0 && !isset($this->$lastKey->{$keys[0]})) {
            throw new \RuntimeException(sprintf("Key '%s->%s' does not exist.", $lastKey, $keys[0]));
        }
        if (count($keys) > 0 && $this->$lastKey instanceof Map) {
            return $this->merge(new self(array($lastKey => $this->$lastKey->setIn($keys, $value))));
        }
        return $this->merge(new self(array($lastKey => $value)));
    }
410537
public static function getChildByArray(array $keys, array $values, $default = null) {
		switch (count($keys)) {
			case 0:
				return $values;
			case 1:
				return array_key_exists($keys[0], $values) ? $values[$keys[0]] : $default;
			case 2:
				return isset($values[$keys[0]][$keys[1]]) ? $values[$keys[0]][$keys[1]] : $default;
			case 3:
				return isset($values[$keys[0]][$keys[1]][$keys[2]]) ? $values[$keys[0]][$keys[1]][$keys[2]] : $default;
			case 4:
				return isset($values[$keys[0]][$keys[1]][$keys[2]][$keys[3]]) ? $values[$keys[0]][$keys[1]][$keys[2]][$keys[3]] : $default;
			default:
				return isset($values[$keys[0]]) ? self::getChildByArray(array_slice($keys, 1), $values[$keys[0]], $default) : $default;
		}
	}
780988
public static function mset($chunk, array $keys, $value) {
        $head = $chunk;
        $last = count($keys)-1;
        foreach($keys as $id => $key) {
            if ($last == $id) {
                if (is_null($value)) {
                    unset($chunk->$key);
                } else {
                    $chunk->$key = $value;
                }
            } else {
                $chunk->$key = isset($chunk->$key)? $chunk->$key : new stdClass();
                $chunk = $chunk->$key;
            }
        }
        return $head;
    }
1114133
protected function data($key, $value = false)
    {
        if (is_array($key)) {
            return $this->data = array_merge($this->data, $key);
        }

        return $this->data[$key] = $value;
    }
620568
public static function register($key, $value, $data = [])
    {
        if (!self::_tableExists()) {
            return;
        }

        self::autoLoad();

        $_data = [
            'value' => $value,
            'editable' => 1,
            'autoload' => true,
            'options' => [],
            'description' => null,
        ];

        $data = array_merge($_data, $data);

        // Don't overrule because we register
        $data['overrule'] = false;

        self::options($key, $data['options']);

        self::write($key, $data['value'], $data);
    }
892707
public static function set(array &$object, $keys, $value)
    {
        $keys = explode('.', $keys);
        $depth = count($keys);
        $key = array_shift($keys);

        if (1 === $depth) {
            $object[$key] = $value;
        } else {
            if (!isset($object[$key])) {
                $object[$key] = [];
            } elseif (!is_array($object[$key])) {
                throw new \Exception('Cannot set property because it already exists as a non \stdClass');
            }

            static::set($object[$key], implode('.', $keys), $value);
        }
    }
1030158
public function addData($key, $value) {
    if (!isset($this->data)) $this->data = array();
    $this->data[$key] = $value;
    return $this;
  }