src/Domain/Value/Identifier/Uri.php
protected static function isValidQuery(?string $query): bool
    {
        if ($query === null || $query === '') {
            return true;
        }

        // http://tools.ietf.org/html/rfc3986#section-3.4
        // query = *( pchar / "/" / "?" )
        // pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
        $pattern = sprintf(
            '/\A(?:[%s%s\/?:@]|(?:%s))*\z/',
            static::UNRESERVED_SET,
            static::SUB_DELIMS_SET,
            static::PCT_ENCODED_SET
        );

        return !!preg_match($pattern, $query);
    }
protected static function isValidQuery(?string $query): bool
    {
        if ($query === null || $query === '') {
            return true;
        }

        // http://tools.ietf.org/html/rfc3986#section-3.4
        // query = *( pchar / "/" / "?" )
        // pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
        $pattern = sprintf(
            '/\A(?:[%s%s\/?:@]|(?:%s))*\z/',
            static::UNRESERVED_SET,
            static::SUB_DELIMS_SET,
            static::PCT_ENCODED_SET
        );

        return !!preg_match($pattern, $query);
    }
protected static function isValidQuery ( ? string $ query ) : bool { if ( $ query === null || $ query === '' ) { return true ; } // http://tools.ietf.org/html/rfc3986#section-3.4 // query = *( pchar / "/" / "?" ) // pchar = unreserved / pct-encoded / sub-delims / ":" / "@" $ pattern = sprintf ( '/\A(?:[%s%s\/?:@]|(?:%s))*\z/' , static :: UNRESERVED_SET , static :: SUB_DELIMS_SET , static :: PCT_ENCODED_SET ) ; return ! ! preg_match ( $ pattern , $ query ) ; }
Checks if a query is valid

@param string|null $query The query

@return bool
Checks if a query is valid