Read the given string from cache or convert to needle case and save to cache.

@param string $value
@param string $name
@param string $delimiter used only snake case
@return string
770351
public static function cache( $value, $name, $delimiter = null )
	{
		if( $value === '' )
		{
			return $value;
		}

		$func = $name;
		$arg2 = $name == "snake";

		if( $arg2 )
		{
			if( is_null($delimiter) )
			{
				$delimiter = "_";
			}
		}
		else if( ($arg2 = $arg2 == "ascii") )
		{
			if( is_null($delimiter) )
			{
				$delimiter = "en";
			}
		}

		if( $arg2 )
		{
			$name .= $delimiter;
		}

		if( isset(self::$cache[$name][$value]) )
		{
			return self::$cache[$name][$value];
		}

		return self::$cache[$name][$value] = ( $func == "snake" ? static::snake($value, $delimiter) : static::$func($value) );
	}
305799
private function parseSingle( $key, $value, $string, $index = null )
    {
        if ( isset( $index ) ) {
            $string = str_replace( $this->l_delim . '%index%' . $this->r_delim, $index, $string );
        }
        return str_replace( $this->l_delim . $key . $this->r_delim, $value, $string );
    }
589233
static function get($name)
    {
        $name = StringHelper::toLittleCamelCase($name);
        
        $value = null;
        
        if (method_exists(get_called_class(), $name)) {
            $value = static::$name();
        }
        
        if (is_array($value)) {
            $value = implode('<br>', $value);
        }
        
        return $value;
    }
18784
public function snakeCase($value, $delimiter = '_')
	{
		$replace = '$1'.$delimiter.'$2';

		return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value));
	}
1106638
public static function snake($value, $delimiter = '_', $encoding = null)
    {
        return (new Rope($value, $encoding))->toSnake($delimiter)->toString();
    }
1026134
protected static function hToSnakeCase($str, $delimiter = '_')
    {
        $str = lcfirst($str);
        $lowerCase = strtolower($str);
        $result = '';
        $length = strlen($str);
        for ($i = 0; $i < $length; $i++) {
            $result .= ($str[$i] === $lowerCase[$i] ? '' : $delimiter) . $lowerCase[$i];
        }
        return $result;
    }
408081
public static function snake($value, $delimiter = '_')
        {
            $replace = '$1' . $delimiter . '$2';
            return ctype_lower($value) ? $value : static::lower(preg_replace('/(.)([A-Z])/', $replace, $value));
        }
185419
private static function delimitString(string $string, string $delimiter): string
    {
        $output = [];

        if (preg_match('/\A[a-z0-9]+\z/ui', $string) && strtoupper($string) !== $string) {
            $parts = self::explodeOnCaps($string);
        } else {
            $parts = self::explodeOnDelims($string);
        }

        foreach ($parts as $part) {
            $output[] = $part.$delimiter;
        }

        return rtrim(implode('', $output), $delimiter);
    }
790089
public static function snake($value, $delimiter = '_')
    {
        if (!ctype_lower($value)) {
            $value = preg_replace('/\s+/', '', $value);
            $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1' . $delimiter, $value));
        }

        return $value;
    }
589653
public function write($name, $value)
    {
        $path = explode('.', $name);
        $key = array_shift($path);

        $exists = $this->checkCache($key);

        if ($path) {
            if (!$exists) {
                $this->cache[$key] = new ArrayHelper();
            }
            $this->cache[$key]->set($path, $value);
        } else {
            $this->cache[$key] = new ArrayHelper($value);
        }

        return $exists ? $this->updateRecord($key) : $this->insertRecord($key);
    }
497439
protected static function stringToArray(
        string $delimiter,
        int $limit = PHP_INT_MAX,
        RuleInterface $next = null
    ): RuleInterface {
        return $next === null ?
            new StringToArray($delimiter, $limit) : new AndOperator(new StringToArray($delimiter, $limit), $next);
    }
1335470
public static function readableFor($value, string $separator = '; '): string
    {
        if (!static::accepts($value)) {
            throw new InvalidValueException($value, static::class);
        }
        if ($value === self::NONE) {
            return static::readableForNone();
        }

        $humanRepresentations = static::readables();

        if (isset($humanRepresentations[$value])) {
            return $humanRepresentations[$value];
        }

        $parts = [];

        foreach ($humanRepresentations as $flag => $readableValue) {
            if ($flag === ($flag & $value)) {
                $parts[] = $readableValue;
            }
        }

        return implode($separator, $parts);
    }
679979
public static function string(string $name, ?string $value = null, int $expire = 0): RedisString
    {
        //创建String对象
        $string = new RedisString(self::handle(), $name);

        //设置值
        if (!is_null($value)) {
            $string->set($value, $expire);
        }

        //返回
        return $string;
    }
81201
public static function delimit($string, $delimiter = '_')
    {
        $cacheKey = __FUNCTION__ . $delimiter;

        $result = static::_cache($cacheKey, $string);

        if ($result === false) {
            $result = mb_strtolower(preg_replace('/(?<=\\w)([A-Z])/', $delimiter . '\\1', $string));
            static::_cache($cacheKey, $string, $result);
        }

        return $result;
    }
354424
public function append($key, $value, $delimiter = ',')
    {
        $newValue = $value;
        if (isset($this->properties[$key]) && !empty($this->properties[$key])) {
            $newValue = $this->properties[$key] . $delimiter . $value;
        }
        $this->properties[$key] = $newValue;
    }
953589
protected function getValueFromParameterString($name, $paramString, $value)
    {
        $original = $paramString;

        while (preg_match('@^(\[([^\]]+)\])@', $paramString, $matches)) {
            $key = $matches[2];
            $paramString = str_replace($matches[1], '', $paramString);

            if (!isset($value[$key])) {
                throw new Exception\ParameterKeyDoesNotExistException($name, $original);
            }

            $value = $value[$key];

            if (empty($paramString)) {
                break;
            }
        }

        return $value;
    }
1145389
public function decode($value, $offset, $name)
    {
        if ($this->isDynamicArray($name)) {
            $arrayOffset = (int) Utils::toBn('0x' . mb_substr($value, $offset * 2, 64))->toString();
            $length = (int) Utils::toBn('0x' . mb_substr($value, $arrayOffset * 2, 64))->toString();
            $arrayStart = $arrayOffset + 32;

            $nestedName = $this->nestedName($name);
            $nestedStaticPartLength = $this->staticPartLength($nestedName);
            $roundedNestedStaticPartLength = floor(($nestedStaticPartLength + 31) / 32) * 32;
            $result = [];

            for ($i=0; $i<$length * $roundedNestedStaticPartLength; $i+=$roundedNestedStaticPartLength) {
                $result[] = $this->decode($value, $arrayStart + $i, $nestedName);
            }
            return $result;
        } elseif ($this->isStaticArray($name)) {
            $length = $this->staticArrayLength($name);
            $arrayStart = $offset;

            $nestedName = $this->nestedName($name);
            $nestedStaticPartLength = $this->staticPartLength($nestedName);
            $roundedNestedStaticPartLength = floor(($nestedStaticPartLength + 31) / 32) * 32;
            $result = [];

            for ($i=0; $i<$length * $roundedNestedStaticPartLength; $i+=$roundedNestedStaticPartLength) {
                $result[] = $this->decode($value, $arrayStart + $i, $nestedName);
            }
            return $result;
        } elseif ($this->isDynamicType()) {
            $dynamicOffset = (int) Utils::toBn('0x' . mb_substr($value, $offset * 2, 64))->toString();
            $length = (int) Utils::toBn('0x' . mb_substr($value, $dynamicOffset * 2, 64))->toString();
            $roundedLength = floor(($length + 31) / 32);
            $param = mb_substr($value, $dynamicOffset * 2, ( 1 + $roundedLength) * 64);
            return $this->outputFormat($param, $name);
        }
        $length = $this->staticPartLength($name);
        $param = mb_substr($value, $offset * 2, $length * 2);

        return $this->outputFormat($param, $name);
    }