Skip to content

Commit

Permalink
Added removeCommunityUserTimeout method
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklaw5 committed Feb 21, 2017
1 parent dce9b21 commit b41511f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Api/Communities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit b41511f

Please sign in to comment.