@param string             $delimiter
@param int                $limit
@param RuleInterface|null $next

@return RuleInterface
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);
    }
309204
public static function ipWithProxy($delimiter = ','): string
    {
        $ip = self::ip();

        if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $ip != $_SERVER['HTTP_X_FORWARDED_FOR']) {
            $ip .= "{$delimiter}{$_SERVER['HTTP_X_FORWARDED_FOR']}";
        }

        return $ip;
    }
213845
protected static function isBool(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new AsBool() : new AndOperator(new AsBool(), $next);
    }
67953
public static function getFirstStatement($query, $delimiter = null)
    {
        $lexer = new Lexer($query, false, $delimiter);
        $list = $lexer->list;

        /**
         * Whether a full statement was found.
         *
         * @var bool
         */
        $fullStatement = false;

        /**
         * The first full statement.
         *
         * @var string
         */
        $statement = '';

        for ($list->idx = 0; $list->idx < $list->count; ++$list->idx) {
            $token = $list->tokens[$list->idx];

            if ($token->type === Token::TYPE_COMMENT) {
                continue;
            }

            $statement .= $token->token;

            if (($token->type === Token::TYPE_DELIMITER) && ! empty($token->token)) {
                $delimiter = $token->token;
                $fullStatement = true;
                break;
            }
        }

        // No statement was found so we return the entire query as being the
        // remaining part.
        if (! $fullStatement) {
            return [
                null,
                $query,
                $delimiter,
            ];
        }

        // At least one query was found so we have to build the rest of the
        // remaining query.
        $query = '';
        for (++$list->idx; $list->idx < $list->count; ++$list->idx) {
            $query .= $list->tokens[$list->idx]->token;
        }

        return [
            trim($statement),
            $query,
            $delimiter,
        ];
    }
1132473
protected static function stringToBool(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new StringToBool() : new AndOperator(new StringToBool(), $next);
    }
312293
protected static function isArray(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new AsArray() : new AndOperator(new AsArray(), $next);
    }
76309
public static String connectByDelimiter(Collection<String> strList, String delimiter) {
        assertStringListNotNull(strList);
        return doConnectByDelimiter(strList, delimiter, null);
    }
179774
public function toString($delimiter = ' ') {
        $queryFieldString = '';

        foreach ($this->queryFields as $fieldName => $fieldBoost) {
            $queryFieldString .= $fieldName;

            if ($fieldBoost != 1.0) {
                $queryFieldString .= '^' . number_format($fieldBoost, 1, '.', '');
            }

            $queryFieldString .= $delimiter;
        }

        return rtrim($queryFieldString, $delimiter);
    }
516235
protected static function stringLengthBetween(int $min, int $max, RuleInterface $next = null): RuleInterface
    {
        return $next === null ?
            new StringLengthBetween($min, $max) :
            new AndOperator(static::stringLengthBetween($min, $max), $next);
    }
369419
public static function explode($string, $delimiter)
    {
        if (!String::isValid($string) ||
            String::isEmpty($string)) {
            return false;
        }

        return explode($delimiter, $string);
    }
1086857
public function parse( $data = null, $type = null, $delimiter = null ) {

		if ( ! empty( $data ) ) {
			$this->input = $data;
		}

		if ( ! empty( $type ) && in_array( $type, $this->types, true ) ) {
			$this->type = $type;
		}

		if ( !empty( $delimiter ) )
			$this->delimiter = $delimiter;

		if ( method_exists( $this, "parse_{$this->type}" ) ) {
			return call_user_func( array( $this, 'parse_' . $this->type ) );
		}

		return $this->parsed;
	}
1199318
private function processParams($uri, $delimiter = ':')
    {
        if (strpos($uri, $delimiter) !== false) {
            preg_match_all(static::paramsRegex(), $uri, $matches, PREG_SET_ORDER);

            foreach ($matches as $match) {
                $param = explode($delimiter, $match[1]);
                if (count($param) === 2) {
                    $plain_var = filter_var($param[1], FILTER_SANITIZE_STRING);
                    $this->params[$param[0]] = $plain_var;
                    $uri = str_replace($match[0], '', $uri);
                }
            }
        }
        return $uri;
    }
106273
public static function toManyRelationship(string $type, RuleInterface $next = null): RuleInterface
    {
        $primary = new ToManyRelationshipTypeCheckerRule($type);

        return $next === null ? $primary : new AndOperator($primary, $next);
    }
863904
public function split($delimiter = ' ') {
        $delimiter = (empty($delimiter)) ? ' ' : $delimiter;

        return explode($delimiter, $this->string);
    }
317659
public function pregQuote(string $delimiter = ''): self
    {
        return new self(\preg_quote((string) $this, $delimiter), $this->encoding);
    }
494521
protected static function stringToFloat(RuleInterface $next = null): RuleInterface
    {
        return $next === null ? new StringToFloat() : new AndOperator(new StringToFloat(), $next);
    }
1298542
protected static function between($lowerLimit, $upperLimit, RuleInterface $next = null): RuleInterface
    {
        $areLimitsDates = $lowerLimit instanceof DateTimeInterface && $upperLimit instanceof DateTimeInterface;

        return $next === null ?
            ($areLimitsDates ?
                new DateTimeBetween($lowerLimit, $upperLimit) : new NumericBetween($lowerLimit, $upperLimit)) :
            new AndOperator(static::between($lowerLimit, $upperLimit), $next);
    }