public static function setParams($query, array $params = []) {
        Str::assert($query, 'query');

        return array_reduce($params, function($query, $param) {
            $param = self::getStringRepresentation($param);

            return strpos($query, '?') ? substr_replace($query, $param, strpos($query, '?'), strlen('?')) : $query;
        }, $query);
    }