Skip to content

Commit

Permalink
Compatible with PHP7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DoveChen committed Aug 28, 2023
1 parent d127ddd commit 689a1b7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/dataStructure/ExternalContactWay.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function CheckExternalContactWayAddArgs ($externalContactWay)
if ($externalContactWay->type == ExternalContactWay::TYPE_ONLY) {
Utils::checkNotEmptyArray($externalContactWay->user, 'external contact user');

if (count($externalContactWay->user) > 1) {
if (is_array($externalContactWay->user) && count($externalContactWay->user) > 1) {
throw new \ParameterError('user only can be one');
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/dataStructure/LinkedcorpMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public static function pareFromArray ($arr)
*/
public static function CheckMessageSendArgs ($args)
{
if (count($args->touser) > 1000) {
if (is_array($args->touser) && count($args->touser) > 1000) {
throw new \QyApiError("touser should be no more than 1000");
}
if (count($args->toparty) > 100) {
if (is_array($args->toparty) && count($args->toparty) > 100) {
throw new \QyApiError("toparty should be no more than 100");
}
if (count($args->totag) > 100) {
if (is_array($args->totag) && count($args->totag) > 100) {
throw new \QyApiError("toparty should be no more than 100");
}

Expand Down
6 changes: 3 additions & 3 deletions src/dataStructure/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public static function pareFromArray ($arr)
*/
public static function CheckMessageSendArgs ($args)
{
if (count($args->touser) > 1000) {
if (is_array($args->touser) && count($args->touser) > 1000) {
throw new \QyApiError("touser should be no more than 1000");
}
if (count($args->toparty) > 100) {
if (is_array($args->toparty) && count($args->toparty) > 100) {
throw new \QyApiError("toparty should be no more than 100");
}
if (count($args->totag) > 100) {
if (is_array($args->totag) && count($args->totag) > 100) {
throw new \QyApiError("toparty should be no more than 100");
}

Expand Down
2 changes: 1 addition & 1 deletion src/dataStructure/TaskcardMesssageContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static function CheckMessageSendArgs ($args)
Utils::checkNotEmptyStr($args->task_id, 'task_id');
Utils::checkNotEmptyArray($args->btn, 'btn');

if (count($args->btn) > 2) {
if (is_array($args->btn) && count($args->btn) > 2) {
throw new \QyApiError('btn only can be one or two');
}

Expand Down
2 changes: 1 addition & 1 deletion src/dataStructure/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static function CheckUserBatchDeleteArgs ($userIdList)
foreach ($userIdList as $userId) {
Utils::checkNotEmptyStr($userId, "userid");
}
if (count($userIdList) > 200) {
if (is_array($userIdList) && count($userIdList) > 200) {
throw new \QyApiError("no more than 200 userid once");
}
}
Expand Down

0 comments on commit 689a1b7

Please sign in to comment.