private static function recursiveSetFromKey($data, $key, $value)
    {
        if (empty($key)) {
            return $value;
        } else {
            if (!is_array($data)) {
                $data = [];
            }
            $currentKey = array_shift($key);

            if (!isset($data[$currentKey])) {
                $data[$currentKey] = [];
            }

            $data[$currentKey] = self::recursiveSetFromKey($data[$currentKey], $key, $value);
            return $data;
        }
    }