src/Variables/VariableProvider.php
private function typeParse($value, $type)
    {
        $const_str = sprintf('REGEX_%s_SYNTAX', strtoupper($type));
        $regex = constant('\M1\Vars\Variables\VariableProvider::'.$const_str);

        $matches = $this->fetchVariableMatches($value, $regex);

        if (is_array($matches)) {
            if (count($matches[0]) === 1 && $value === $matches[0][0]) {
                return $this->fetchVariable(trim($matches[1][0]), $type);
            }

            $value = $this->doReplacements($value, $matches, $type);
        }
        return $value;
    }
private function typeParse($value, $type)
    {
        $const_str = sprintf('REGEX_%s_SYNTAX', strtoupper($type));
        $regex = constant('\M1\Vars\Variables\VariableProvider::'.$const_str);

        $matches = $this->fetchVariableMatches($value, $regex);

        if (is_array($matches)) {
            if (count($matches[0]) === 1 && $value === $matches[0][0]) {
                return $this->fetchVariable(trim($matches[1][0]), $type);
            }

            $value = $this->doReplacements($value, $matches, $type);
        }
        return $value;
    }
Parses the string based on the type of variable

@param string $value The string to parse
@param string $type  The variable type

@return string The parsed variable