VersionPress\Utils\QueryLanguageUtils::tokenizeValue PHP Method

tokenizeValue() private static method

Tokens: * => VALUE_WILDCARD, else => VALUE_STRING
private static tokenizeValue ( $value ) : array
$value
return array
    private static function tokenizeValue($value)
    {
        preg_match_all(self::$valueWildcardRegex, $value, $matches);
        $tokens = [];
        foreach ($matches[0] as $valuePart) {
            if ($valuePart === '*') {
                $tokens[] = ['type' => self::VALUE_WILDCARD];
            } else {
                if ($valuePart === '\\*') {
                    $tokens[] = ['type' => self::VALUE_STRING, 'value' => '*'];
                } else {
                    if ($valuePart === '\\\\') {
                        $tokens[] = ['type' => self::VALUE_STRING, 'value' => '\\'];
                    } else {
                        $tokens[] = ['type' => self::VALUE_STRING, 'value' => $valuePart];
                    }
                }
            }
        }
        return $tokens;
    }