private static function htmlencodeParams(array $params, $removeKey = '')
    {
        if ($removeKey) {
            unset($params[$removeKey]);
        }

        return array_map(
            function ($val) {
                return htmlspecialchars($val, ENT_QUOTES);
            },
            $params
        );
    }