public function userIdToOpenid(string $userId, int $agentId = null)
    {
        $params = [
            'userid' => $userId,
            'agentid' => $agentId,
        ];

        return $this->httpPostJson('cgi-bin/user/convert_to_openid', $params);
    }
public function userIdToOpenid(string $userId, int $agentId = null)
    {
        $params = [
            'userid' => $userId,
            'agentid' => $agentId,
        ];

        return $this->httpPostJson('cgi-bin/user/convert_to_openid', $params);
    }
public function userIdToOpenid ( string $ userId , int $ agentId = null ) { $ params = [ 'userid' => $ userId , 'agentid' => $ agentId , ] ; return $ this -> httpPostJson ( 'cgi-bin/user/convert_to_openid' , $ params ) ; }
Convert userId to openid.

@param string   $userId
@param int|null $agentId

@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
Convert userId to openid .