|
10 | 10 | */
|
11 | 11 | class Collaborators extends AbstractApi
|
12 | 12 | {
|
13 |
| - public function all($username, $repository) |
| 13 | + /** |
| 14 | + * @link https://developer.github.com/v3/repos/collaborators/#list-collaborators |
| 15 | + * |
| 16 | + * @param $username |
| 17 | + * @param $repository |
| 18 | + * @param array $params |
| 19 | + * @return array|string |
| 20 | + */ |
| 21 | + public function all($username, $repository, array $params = []) |
14 | 22 | {
|
15 |
| - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators'); |
| 23 | + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators', $params); |
16 | 24 | }
|
17 | 25 |
|
| 26 | + /** |
| 27 | + * @link https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator |
| 28 | + * |
| 29 | + * @param $username |
| 30 | + * @param $repository |
| 31 | + * @param $collaborator |
| 32 | + * @return array|string |
| 33 | + */ |
18 | 34 | public function check($username, $repository, $collaborator)
|
19 | 35 | {
|
20 | 36 | return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator));
|
21 | 37 | }
|
22 | 38 |
|
23 |
| - public function add($username, $repository, $collaborator) |
| 39 | + /** |
| 40 | + * @link https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator |
| 41 | + * |
| 42 | + * @param $username |
| 43 | + * @param $repository |
| 44 | + * @param $collaborator |
| 45 | + * @param array $params |
| 46 | + * @return array|string |
| 47 | + */ |
| 48 | + public function add($username, $repository, $collaborator, array $params = []) |
24 | 49 | {
|
25 |
| - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); |
| 50 | + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator), $params); |
26 | 51 | }
|
27 | 52 |
|
| 53 | + /** |
| 54 | + * @link https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator |
| 55 | + * |
| 56 | + * @param $username |
| 57 | + * @param $repository |
| 58 | + * @param $collaborator |
| 59 | + * @return array|string |
| 60 | + */ |
28 | 61 | public function remove($username, $repository, $collaborator)
|
29 | 62 | {
|
30 | 63 | return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator));
|
|
0 commit comments