diff --git a/VKAPI/Handlers/Account.php b/VKAPI/Handlers/Account.php index dd6cfa7b..a20c42be 100644 --- a/VKAPI/Handlers/Account.php +++ b/VKAPI/Handlers/Account.php @@ -66,6 +66,8 @@ final class Account extends VKAPIRequestHandler function getCounters(string $filter = ""): object { + $this->requireUser(); + return (object) [ "friends" => $this->getUser()->getFollowersCount(), "notifications" => $this->getUser()->getNotificationsCount(), diff --git a/VKAPI/Handlers/Likes.php b/VKAPI/Handlers/Likes.php index 644646e5..9501b433 100644 --- a/VKAPI/Handlers/Likes.php +++ b/VKAPI/Handlers/Likes.php @@ -54,11 +54,7 @@ final class Likes extends VKAPIRequestHandler case "post": $user = (new UsersRepo)->get($user_id); if (is_null($user)) - return (object) [ - "liked" => 0, - "copied" => 0, - "sex" => 0 - ]; + $this->fail(100, "One of the parameters specified was missing or invalid: user not found"); $post = (new PostsRepo)->getPostById($owner_id, $item_id); if (is_null($post)) diff --git a/VKAPI/Handlers/Polls.php b/VKAPI/Handlers/Polls.php index 9036a02c..be947a44 100755 --- a/VKAPI/Handlers/Polls.php +++ b/VKAPI/Handlers/Polls.php @@ -75,7 +75,7 @@ final class Polls extends VKAPIRequestHandler try { $poll->vote($this->getUser(), explode(",", $answers_ids)); - return 0; + return 1; } catch(AlreadyVotedException $ex) { return 0; } catch(PollLockedException $ex) { @@ -97,7 +97,7 @@ final class Polls extends VKAPIRequestHandler try { $poll->revokeVote($this->getUser()); - return 0; + return 1; } catch(PollLockedException $ex) { $this->fail(15, "Access denied: Poll is locked or isn't revotable"); } catch(InvalidOptionException $ex) {