diff --git a/lib/Github/Api/Repository/Collaborators.php b/lib/Github/Api/Repository/Collaborators.php index 116d8cc5a38..86812be9538 100644 --- a/lib/Github/Api/Repository/Collaborators.php +++ b/lib/Github/Api/Repository/Collaborators.php @@ -10,21 +10,54 @@ */ class Collaborators extends AbstractApi { - public function all($username, $repository) + /** + * @link https://developer.github.com/v3/repos/collaborators/#list-collaborators + * + * @param $username + * @param $repository + * @param array $params + * @return array|string + */ + public function all($username, $repository, array $params = []) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators'); + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators', $params); } + /** + * @link https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator + * + * @param $username + * @param $repository + * @param $collaborator + * @return array|string + */ public function check($username, $repository, $collaborator) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); } - public function add($username, $repository, $collaborator) + /** + * @link https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + * + * @param $username + * @param $repository + * @param $collaborator + * @param array $params + * @return array|string + */ + public function add($username, $repository, $collaborator, array $params = []) { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator), $params); } + /** + * @link https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator + * + * @param $username + * @param $repository + * @param $collaborator + * @return array|string + */ public function remove($username, $repository, $collaborator) { return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator));