if (count($this->touser) > 1000) throw new QyApiError("touser should be no more than 1000");
if (count($this->toparty) > 100) throw new QyApiError("toparty should be no more than 100");
if (count($this->totag) > 100) throw new QyApiError("toparty should be no more than 100");
在实例化Message类后,若这三个参数中的某个参数未赋值时,count(null)会导致报错。
同文件中第280、359行也有类似问题,可以一起改下。
public $articles = null;
之前修正过类似问题,php7.2中的count($args)函数,$args参数需为数组或者Countable对象,否则会报错。 https://github.com/sbzhu/weworkapi_php/issues/13
在weworkapi_php-master\api\datastructure\Message.class.php第9、10、11行:
这三个参数初始值建议改为array(),而不用null。 因为在第18、19、20行会对这三个参数使用count()函数
在实例化Message类后,若这三个参数中的某个参数未赋值时,count(null)会导致报错。
同文件中第280、359行也有类似问题,可以一起改下。
public $articles = null;