php版本7.4.3和8.2都會報(bào)錯
使用的是Push插件,調(diào)用如下代碼中的send方法時(shí)給出的報(bào)錯。
<?php
namespace app\controller;
use Webman\Push\Api;
use support\Request;
class Push{
private $pusher;
public function __construct(){
$this->pusher = new Api(
'http://127.0.0.1:3232',
config('plugin.webman.push.app.app_key'),
config('plugin.webman.push.app.app_secret')
);
}
// 服務(wù)端推送消息
public function send(){
$this->pusher->trigger('notice', 'message', [
'id'=>1,
'title'=>'公告標(biāo)題',
'summary'=>'公告摘要'
]);
$this->pusher->trigger('private-user-1', 'message', '私有消息');
}
}
Error: Object of class Webman\Push\Api could not be converted to string in /www/wwwroot/xxx/vendor/workerman/workerman/Protocols/Http.php:247
Stack trace:
操作系統(tǒng) Linux
Workerman version:4.1.15
PHP version:7.4.3