From b41511f14af6775c60fe49e89fd44591f4c754f2 Mon Sep 17 00:00:00 2001 From: Nicholas Law Date: Wed, 22 Feb 2017 06:18:41 +1100 Subject: [PATCH] Added removeCommunityUserTimeout method --- src/Api/Communities.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Api/Communities.php b/src/Api/Communities.php index 7e61c5e..f0fb29a 100644 --- a/src/Api/Communities.php +++ b/src/Api/Communities.php @@ -491,4 +491,27 @@ public function timeoutCommunityUser($communityId, $userId, $accessToken, $durat return $this->put(sprintf('communities/%s/timeouts/%s', $communityId, $userId), $params, $accessToken); } + + /** + * Remove a timeout from a community user + * + * @param string $communityId + * @param int $userId + * @param string $accessToken + * @throws EndpointNotSupportedByApiVersionException + * @throws InvalidIdentifierException + * @return null|array|json + */ + public function removeCommunityUserTimeout($communityId, $userId, $accessToken) + { + if (!$this->apiVersionIsGreaterThanV4()) { + throw new EndpointNotSupportedByApiVersionException('communities'); + } + + if (!is_numeric($userId)) { + throw new InvalidIdentifierException('user'); + } + + return $this->delete(sprintf('communities/%s/timeouts/%s', $communityId, $userId), [], $accessToken); + } }