@@ -12,38 +12,38 @@ |
||
12 | 12 | class Blobs extends AbstractGitData |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * Get a Blob |
|
17 | - * |
|
18 | - * @link https://developer.github.com/v3/git/blobs/#get-a-blob |
|
19 | - * |
|
20 | - * @param string $sha |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function getBlob(string $sha): array |
|
25 | - { |
|
26 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/git/blobs/:sha', |
|
27 | - $this->getGitData()->getOwner(), $this->getGitData()->getRepo(), $sha)); |
|
28 | - } |
|
15 | + /** |
|
16 | + * Get a Blob |
|
17 | + * |
|
18 | + * @link https://developer.github.com/v3/git/blobs/#get-a-blob |
|
19 | + * |
|
20 | + * @param string $sha |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function getBlob(string $sha): array |
|
25 | + { |
|
26 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/git/blobs/:sha', |
|
27 | + $this->getGitData()->getOwner(), $this->getGitData()->getRepo(), $sha)); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * Create a Blob |
|
32 | - * |
|
33 | - * @link https://developer.github.com/v3/git/blobs/#create-a-blob |
|
34 | - * |
|
35 | - * @param string $content |
|
36 | - * @param string $encoding |
|
37 | - * |
|
38 | - * @return array |
|
39 | - */ |
|
40 | - public function createBlob(string $content, string $encoding = 'utf-8'): array |
|
41 | - { |
|
42 | - return $this->getApi()->request($this->getApi() |
|
43 | - ->sprintf('/repos/:owner/:repo/git/blobs', $this->getGitData()->getOwner(), |
|
44 | - $this->getGitData()->getRepo()), Request::METHOD_POST, [ |
|
45 | - 'content' => $content, |
|
46 | - 'encoding' => $encoding |
|
47 | - ]); |
|
48 | - } |
|
30 | + /** |
|
31 | + * Create a Blob |
|
32 | + * |
|
33 | + * @link https://developer.github.com/v3/git/blobs/#create-a-blob |
|
34 | + * |
|
35 | + * @param string $content |
|
36 | + * @param string $encoding |
|
37 | + * |
|
38 | + * @return array |
|
39 | + */ |
|
40 | + public function createBlob(string $content, string $encoding = 'utf-8'): array |
|
41 | + { |
|
42 | + return $this->getApi()->request($this->getApi() |
|
43 | + ->sprintf('/repos/:owner/:repo/git/blobs', $this->getGitData()->getOwner(), |
|
44 | + $this->getGitData()->getRepo()), Request::METHOD_POST, [ |
|
45 | + 'content' => $content, |
|
46 | + 'encoding' => $encoding |
|
47 | + ]); |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | \ No newline at end of file |
@@ -10,11 +10,11 @@ |
||
10 | 10 | class Miscellaneous extends AbstractReceiver |
11 | 11 | { |
12 | 12 | |
13 | - /** Available sub-Receiver */ |
|
14 | - const EMOJIS = 'Emojis'; |
|
15 | - const GITIGNORE = 'Gitignore'; |
|
16 | - const MARKDOWN = 'Markdown'; |
|
17 | - const META = 'Meta'; |
|
18 | - const RATE_LIMIT = 'RateLimit'; |
|
19 | - const LICENSES = 'Licenses'; |
|
13 | + /** Available sub-Receiver */ |
|
14 | + const EMOJIS = 'Emojis'; |
|
15 | + const GITIGNORE = 'Gitignore'; |
|
16 | + const MARKDOWN = 'Markdown'; |
|
17 | + const META = 'Meta'; |
|
18 | + const RATE_LIMIT = 'RateLimit'; |
|
19 | + const LICENSES = 'Licenses'; |
|
20 | 20 | } |
21 | 21 | \ No newline at end of file |
@@ -13,113 +13,113 @@ |
||
13 | 13 | class Comments extends AbstractIssues |
14 | 14 | { |
15 | 15 | |
16 | - /** |
|
17 | - * List comments on an issue |
|
18 | - * |
|
19 | - * @link https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue |
|
20 | - * |
|
21 | - * @param int $number |
|
22 | - * |
|
23 | - * @return array |
|
24 | - */ |
|
25 | - public function listIssueComments(int $number): array |
|
26 | - { |
|
27 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/comments', |
|
28 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
29 | - } |
|
16 | + /** |
|
17 | + * List comments on an issue |
|
18 | + * |
|
19 | + * @link https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue |
|
20 | + * |
|
21 | + * @param int $number |
|
22 | + * |
|
23 | + * @return array |
|
24 | + */ |
|
25 | + public function listIssueComments(int $number): array |
|
26 | + { |
|
27 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/comments', |
|
28 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * List comments in a repository |
|
33 | - * |
|
34 | - * @link https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository |
|
35 | - * |
|
36 | - * @param string $sort |
|
37 | - * @param string $direction |
|
38 | - * @param string $since |
|
39 | - * |
|
40 | - * @return array |
|
41 | - */ |
|
42 | - public function listRepositoryComments(string $sort = AbstractApi::SORT_CREATED, |
|
43 | - string $direction = AbstractApi::DIRECTION_DESC, |
|
44 | - string $since = 'now'): array |
|
45 | - { |
|
46 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments?:args', |
|
47 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), http_build_query([ |
|
48 | - 'sort' => $sort, |
|
49 | - 'direction' => $direction, |
|
50 | - 'since' => $since |
|
51 | - ]))); |
|
52 | - } |
|
31 | + /** |
|
32 | + * List comments in a repository |
|
33 | + * |
|
34 | + * @link https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository |
|
35 | + * |
|
36 | + * @param string $sort |
|
37 | + * @param string $direction |
|
38 | + * @param string $since |
|
39 | + * |
|
40 | + * @return array |
|
41 | + */ |
|
42 | + public function listRepositoryComments(string $sort = AbstractApi::SORT_CREATED, |
|
43 | + string $direction = AbstractApi::DIRECTION_DESC, |
|
44 | + string $since = 'now'): array |
|
45 | + { |
|
46 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments?:args', |
|
47 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), http_build_query([ |
|
48 | + 'sort' => $sort, |
|
49 | + 'direction' => $direction, |
|
50 | + 'since' => $since |
|
51 | + ]))); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Get a single comment |
|
56 | - * |
|
57 | - * @link https://developer.github.com/v3/issues/comments/#get-a-single-comment |
|
58 | - * |
|
59 | - * @param int $id |
|
60 | - * |
|
61 | - * @return array |
|
62 | - */ |
|
63 | - public function getComment(int $id): array |
|
64 | - { |
|
65 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id', |
|
66 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id)); |
|
67 | - } |
|
54 | + /** |
|
55 | + * Get a single comment |
|
56 | + * |
|
57 | + * @link https://developer.github.com/v3/issues/comments/#get-a-single-comment |
|
58 | + * |
|
59 | + * @param int $id |
|
60 | + * |
|
61 | + * @return array |
|
62 | + */ |
|
63 | + public function getComment(int $id): array |
|
64 | + { |
|
65 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id', |
|
66 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id)); |
|
67 | + } |
|
68 | 68 | |
69 | - /** |
|
70 | - * Create a comment |
|
71 | - * |
|
72 | - * @link https://developer.github.com/v3/issues/comments/#create-a-comment |
|
73 | - * |
|
74 | - * @param int $number |
|
75 | - * @param string $body |
|
76 | - * |
|
77 | - * @return array |
|
78 | - */ |
|
79 | - public function createComment(int $number, string $body): array |
|
80 | - { |
|
81 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/comments', |
|
82 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_POST, [ |
|
83 | - 'body' => $body |
|
84 | - ]); |
|
85 | - } |
|
69 | + /** |
|
70 | + * Create a comment |
|
71 | + * |
|
72 | + * @link https://developer.github.com/v3/issues/comments/#create-a-comment |
|
73 | + * |
|
74 | + * @param int $number |
|
75 | + * @param string $body |
|
76 | + * |
|
77 | + * @return array |
|
78 | + */ |
|
79 | + public function createComment(int $number, string $body): array |
|
80 | + { |
|
81 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/comments', |
|
82 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_POST, [ |
|
83 | + 'body' => $body |
|
84 | + ]); |
|
85 | + } |
|
86 | 86 | |
87 | - /** |
|
88 | - * Edit a comment |
|
89 | - * |
|
90 | - * @link https://developer.github.com/v3/issues/comments/#edit-a-comment |
|
91 | - * |
|
92 | - * @param int $id |
|
93 | - * @param string $body |
|
94 | - * |
|
95 | - * @return array |
|
96 | - */ |
|
97 | - public function editComment(int $id, string $body): array |
|
98 | - { |
|
99 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id', |
|
100 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id), Request::METHOD_PATCH, [ |
|
101 | - 'body' => $body |
|
102 | - ]); |
|
103 | - } |
|
87 | + /** |
|
88 | + * Edit a comment |
|
89 | + * |
|
90 | + * @link https://developer.github.com/v3/issues/comments/#edit-a-comment |
|
91 | + * |
|
92 | + * @param int $id |
|
93 | + * @param string $body |
|
94 | + * |
|
95 | + * @return array |
|
96 | + */ |
|
97 | + public function editComment(int $id, string $body): array |
|
98 | + { |
|
99 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id', |
|
100 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id), Request::METHOD_PATCH, [ |
|
101 | + 'body' => $body |
|
102 | + ]); |
|
103 | + } |
|
104 | 104 | |
105 | - /** |
|
106 | - * Delete a comment |
|
107 | - * |
|
108 | - * @link https://developer.github.com/v3/issues/comments/#delete-a-comment |
|
109 | - * |
|
110 | - * @param int $id |
|
111 | - * |
|
112 | - * @return bool |
|
113 | - */ |
|
114 | - public function deleteComment(int $id): bool |
|
115 | - { |
|
116 | - $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id', |
|
117 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id), Request::METHOD_DELETE); |
|
105 | + /** |
|
106 | + * Delete a comment |
|
107 | + * |
|
108 | + * @link https://developer.github.com/v3/issues/comments/#delete-a-comment |
|
109 | + * |
|
110 | + * @param int $id |
|
111 | + * |
|
112 | + * @return bool |
|
113 | + */ |
|
114 | + public function deleteComment(int $id): bool |
|
115 | + { |
|
116 | + $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/comments/:id', |
|
117 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id), Request::METHOD_DELETE); |
|
118 | 118 | |
119 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
120 | - return true; |
|
121 | - } |
|
119 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
120 | + return true; |
|
121 | + } |
|
122 | 122 | |
123 | - return false; |
|
124 | - } |
|
123 | + return false; |
|
124 | + } |
|
125 | 125 | } |
126 | 126 | \ No newline at end of file |
@@ -10,45 +10,45 @@ |
||
10 | 10 | class Events extends AbstractIssues |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * List events for an issue |
|
15 | - * |
|
16 | - * @link https://developer.github.com/v3/issues/events/#list-events-for-an-issue |
|
17 | - * |
|
18 | - * @param int $issueNumber |
|
19 | - * |
|
20 | - * @return array |
|
21 | - */ |
|
22 | - public function listIssueEvents(int $issueNumber): array |
|
23 | - { |
|
24 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:issue_number/events', |
|
25 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $issueNumber)); |
|
26 | - } |
|
13 | + /** |
|
14 | + * List events for an issue |
|
15 | + * |
|
16 | + * @link https://developer.github.com/v3/issues/events/#list-events-for-an-issue |
|
17 | + * |
|
18 | + * @param int $issueNumber |
|
19 | + * |
|
20 | + * @return array |
|
21 | + */ |
|
22 | + public function listIssueEvents(int $issueNumber): array |
|
23 | + { |
|
24 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:issue_number/events', |
|
25 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $issueNumber)); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * List events for a repository |
|
30 | - * |
|
31 | - * @link https://developer.github.com/v3/issues/events/#list-events-for-a-repository |
|
32 | - * @return array |
|
33 | - */ |
|
34 | - public function listRepositoryEvents(): array |
|
35 | - { |
|
36 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events', |
|
37 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo())); |
|
38 | - } |
|
28 | + /** |
|
29 | + * List events for a repository |
|
30 | + * |
|
31 | + * @link https://developer.github.com/v3/issues/events/#list-events-for-a-repository |
|
32 | + * @return array |
|
33 | + */ |
|
34 | + public function listRepositoryEvents(): array |
|
35 | + { |
|
36 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events', |
|
37 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo())); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * Get a single event |
|
42 | - * |
|
43 | - * @link https://developer.github.com/v3/issues/events/#get-a-single-event |
|
44 | - * |
|
45 | - * @param int $id |
|
46 | - * |
|
47 | - * @return array |
|
48 | - */ |
|
49 | - public function getEvent(int $id): array |
|
50 | - { |
|
51 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events/:id', |
|
52 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id)); |
|
53 | - } |
|
40 | + /** |
|
41 | + * Get a single event |
|
42 | + * |
|
43 | + * @link https://developer.github.com/v3/issues/events/#get-a-single-event |
|
44 | + * |
|
45 | + * @param int $id |
|
46 | + * |
|
47 | + * @return array |
|
48 | + */ |
|
49 | + public function getEvent(int $id): array |
|
50 | + { |
|
51 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/events/:id', |
|
52 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $id)); |
|
53 | + } |
|
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -12,194 +12,194 @@ |
||
12 | 12 | class Labels extends AbstractIssues |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * List all labels for this repository |
|
17 | - * |
|
18 | - * @link https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository |
|
19 | - * @return array |
|
20 | - */ |
|
21 | - public function listRepositoryLabels(): array |
|
22 | - { |
|
23 | - return $this->getApi()->request($this->getApi() |
|
24 | - ->sprintf('/repos/:owner/:repo/labels', $this->getIssues()->getOwner(), |
|
25 | - $this->getIssues()->getRepo())); |
|
26 | - } |
|
27 | - |
|
28 | - /** |
|
29 | - * Get a single label |
|
30 | - * |
|
31 | - * @link https://developer.github.com/v3/issues/labels/#get-a-single-label |
|
32 | - * |
|
33 | - * @param string $name |
|
34 | - * |
|
35 | - * @return array |
|
36 | - */ |
|
37 | - public function getLabel(string $name): array |
|
38 | - { |
|
39 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/labels/:name', |
|
40 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $name)); |
|
41 | - } |
|
42 | - |
|
43 | - /** |
|
44 | - * Create a label |
|
45 | - * |
|
46 | - * @link https://developer.github.com/v3/issues/labels/#create-a-label |
|
47 | - * |
|
48 | - * @param string $name |
|
49 | - * @param string $color |
|
50 | - * |
|
51 | - * @return array |
|
52 | - */ |
|
53 | - public function createLabel(string $name, string $color): array |
|
54 | - { |
|
55 | - return $this->getApi()->request($this->getApi() |
|
56 | - ->sprintf('/repos/:owner/:repo/labels', $this->getIssues()->getOwner(), |
|
57 | - $this->getIssues()->getRepo()), Request::METHOD_POST, [ |
|
58 | - 'name' => $name, |
|
59 | - 'color' => $color |
|
60 | - ]); |
|
61 | - } |
|
62 | - |
|
63 | - /** |
|
64 | - * Update a label |
|
65 | - * |
|
66 | - * @link https://developer.github.com/v3/issues/labels/#update-a-label |
|
67 | - * |
|
68 | - * @param string $name |
|
69 | - * @param string $color |
|
70 | - * |
|
71 | - * @return array |
|
72 | - */ |
|
73 | - public function updateLabel(string $name, string $color): array |
|
74 | - { |
|
75 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/labels/:name', |
|
76 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $name), Request::METHOD_PATCH, [ |
|
77 | - 'color' => $color |
|
78 | - ]); |
|
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * Delete a label |
|
83 | - * |
|
84 | - * @link https://developer.github.com/v3/issues/labels/#delete-a-label |
|
85 | - * |
|
86 | - * @param string $name |
|
87 | - * |
|
88 | - * @return bool |
|
89 | - */ |
|
90 | - public function deleteLabel(string $name): bool |
|
91 | - { |
|
92 | - $this->getApi()->request($this->getApi() |
|
93 | - ->sprintf('/repos/:owner/:repo/labels/:name', $this->getIssues()->getOwner(), |
|
94 | - $this->getIssues()->getRepo(), $name)); |
|
95 | - |
|
96 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
97 | - return true; |
|
98 | - } |
|
99 | - |
|
100 | - return false; |
|
101 | - } |
|
102 | - |
|
103 | - /** |
|
104 | - * List labels on an issue |
|
105 | - * |
|
106 | - * @link https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue |
|
107 | - * |
|
108 | - * @param int $number |
|
109 | - * |
|
110 | - * @return array |
|
111 | - */ |
|
112 | - public function listIssueLabels(int $number): array |
|
113 | - { |
|
114 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
115 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
116 | - } |
|
117 | - |
|
118 | - /** |
|
119 | - * Add labels to an issue |
|
120 | - * |
|
121 | - * @link https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue |
|
122 | - * |
|
123 | - * @param int $number |
|
124 | - * |
|
125 | - * @return array |
|
126 | - */ |
|
127 | - public function addIssueLabels(int $number): array |
|
128 | - { |
|
129 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
130 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_POST); |
|
131 | - } |
|
132 | - |
|
133 | - /** |
|
134 | - * Remove a label from an issue |
|
135 | - * |
|
136 | - * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue |
|
137 | - * |
|
138 | - * @param int $number |
|
139 | - * @param string $name |
|
140 | - * |
|
141 | - * @return bool |
|
142 | - */ |
|
143 | - public function removeIssueLabel(int $number, string $name): bool |
|
144 | - { |
|
145 | - $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels/:name', |
|
146 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number, $name), Request::METHOD_DELETE); |
|
147 | - |
|
148 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
149 | - return true; |
|
150 | - } |
|
151 | - |
|
152 | - return false; |
|
153 | - } |
|
154 | - |
|
155 | - /** |
|
156 | - * Replace all labels for an issue |
|
157 | - * |
|
158 | - * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue |
|
159 | - * |
|
160 | - * @param int $number |
|
161 | - * |
|
162 | - * @return array |
|
163 | - */ |
|
164 | - public function replaceIssuesLabels(int $number): array |
|
165 | - { |
|
166 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
167 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_PUT); |
|
168 | - } |
|
169 | - |
|
170 | - /** |
|
171 | - * Remove all labels from an issue |
|
172 | - * |
|
173 | - * @link https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue |
|
174 | - * |
|
175 | - * @param int $number |
|
176 | - * |
|
177 | - * @return bool |
|
178 | - */ |
|
179 | - public function removeIssueLabels(int $number): bool |
|
180 | - { |
|
181 | - $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
182 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_DELETE); |
|
183 | - |
|
184 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
185 | - return true; |
|
186 | - } |
|
187 | - |
|
188 | - return false; |
|
189 | - } |
|
190 | - |
|
191 | - /** |
|
192 | - * Get labels for every issue in a milestone |
|
193 | - * |
|
194 | - * @link https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone |
|
195 | - * |
|
196 | - * @param int $number |
|
197 | - * |
|
198 | - * @return array |
|
199 | - */ |
|
200 | - public function getIssueLabelsInMilestone(int $number): array |
|
201 | - { |
|
202 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number/labels', |
|
203 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
204 | - } |
|
15 | + /** |
|
16 | + * List all labels for this repository |
|
17 | + * |
|
18 | + * @link https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository |
|
19 | + * @return array |
|
20 | + */ |
|
21 | + public function listRepositoryLabels(): array |
|
22 | + { |
|
23 | + return $this->getApi()->request($this->getApi() |
|
24 | + ->sprintf('/repos/:owner/:repo/labels', $this->getIssues()->getOwner(), |
|
25 | + $this->getIssues()->getRepo())); |
|
26 | + } |
|
27 | + |
|
28 | + /** |
|
29 | + * Get a single label |
|
30 | + * |
|
31 | + * @link https://developer.github.com/v3/issues/labels/#get-a-single-label |
|
32 | + * |
|
33 | + * @param string $name |
|
34 | + * |
|
35 | + * @return array |
|
36 | + */ |
|
37 | + public function getLabel(string $name): array |
|
38 | + { |
|
39 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/labels/:name', |
|
40 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $name)); |
|
41 | + } |
|
42 | + |
|
43 | + /** |
|
44 | + * Create a label |
|
45 | + * |
|
46 | + * @link https://developer.github.com/v3/issues/labels/#create-a-label |
|
47 | + * |
|
48 | + * @param string $name |
|
49 | + * @param string $color |
|
50 | + * |
|
51 | + * @return array |
|
52 | + */ |
|
53 | + public function createLabel(string $name, string $color): array |
|
54 | + { |
|
55 | + return $this->getApi()->request($this->getApi() |
|
56 | + ->sprintf('/repos/:owner/:repo/labels', $this->getIssues()->getOwner(), |
|
57 | + $this->getIssues()->getRepo()), Request::METHOD_POST, [ |
|
58 | + 'name' => $name, |
|
59 | + 'color' => $color |
|
60 | + ]); |
|
61 | + } |
|
62 | + |
|
63 | + /** |
|
64 | + * Update a label |
|
65 | + * |
|
66 | + * @link https://developer.github.com/v3/issues/labels/#update-a-label |
|
67 | + * |
|
68 | + * @param string $name |
|
69 | + * @param string $color |
|
70 | + * |
|
71 | + * @return array |
|
72 | + */ |
|
73 | + public function updateLabel(string $name, string $color): array |
|
74 | + { |
|
75 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/labels/:name', |
|
76 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $name), Request::METHOD_PATCH, [ |
|
77 | + 'color' => $color |
|
78 | + ]); |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * Delete a label |
|
83 | + * |
|
84 | + * @link https://developer.github.com/v3/issues/labels/#delete-a-label |
|
85 | + * |
|
86 | + * @param string $name |
|
87 | + * |
|
88 | + * @return bool |
|
89 | + */ |
|
90 | + public function deleteLabel(string $name): bool |
|
91 | + { |
|
92 | + $this->getApi()->request($this->getApi() |
|
93 | + ->sprintf('/repos/:owner/:repo/labels/:name', $this->getIssues()->getOwner(), |
|
94 | + $this->getIssues()->getRepo(), $name)); |
|
95 | + |
|
96 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
97 | + return true; |
|
98 | + } |
|
99 | + |
|
100 | + return false; |
|
101 | + } |
|
102 | + |
|
103 | + /** |
|
104 | + * List labels on an issue |
|
105 | + * |
|
106 | + * @link https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue |
|
107 | + * |
|
108 | + * @param int $number |
|
109 | + * |
|
110 | + * @return array |
|
111 | + */ |
|
112 | + public function listIssueLabels(int $number): array |
|
113 | + { |
|
114 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
115 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
116 | + } |
|
117 | + |
|
118 | + /** |
|
119 | + * Add labels to an issue |
|
120 | + * |
|
121 | + * @link https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue |
|
122 | + * |
|
123 | + * @param int $number |
|
124 | + * |
|
125 | + * @return array |
|
126 | + */ |
|
127 | + public function addIssueLabels(int $number): array |
|
128 | + { |
|
129 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
130 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_POST); |
|
131 | + } |
|
132 | + |
|
133 | + /** |
|
134 | + * Remove a label from an issue |
|
135 | + * |
|
136 | + * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue |
|
137 | + * |
|
138 | + * @param int $number |
|
139 | + * @param string $name |
|
140 | + * |
|
141 | + * @return bool |
|
142 | + */ |
|
143 | + public function removeIssueLabel(int $number, string $name): bool |
|
144 | + { |
|
145 | + $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels/:name', |
|
146 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number, $name), Request::METHOD_DELETE); |
|
147 | + |
|
148 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
149 | + return true; |
|
150 | + } |
|
151 | + |
|
152 | + return false; |
|
153 | + } |
|
154 | + |
|
155 | + /** |
|
156 | + * Replace all labels for an issue |
|
157 | + * |
|
158 | + * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue |
|
159 | + * |
|
160 | + * @param int $number |
|
161 | + * |
|
162 | + * @return array |
|
163 | + */ |
|
164 | + public function replaceIssuesLabels(int $number): array |
|
165 | + { |
|
166 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
167 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_PUT); |
|
168 | + } |
|
169 | + |
|
170 | + /** |
|
171 | + * Remove all labels from an issue |
|
172 | + * |
|
173 | + * @link https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue |
|
174 | + * |
|
175 | + * @param int $number |
|
176 | + * |
|
177 | + * @return bool |
|
178 | + */ |
|
179 | + public function removeIssueLabels(int $number): bool |
|
180 | + { |
|
181 | + $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues/:number/labels', |
|
182 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_DELETE); |
|
183 | + |
|
184 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
185 | + return true; |
|
186 | + } |
|
187 | + |
|
188 | + return false; |
|
189 | + } |
|
190 | + |
|
191 | + /** |
|
192 | + * Get labels for every issue in a milestone |
|
193 | + * |
|
194 | + * @link https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone |
|
195 | + * |
|
196 | + * @param int $number |
|
197 | + * |
|
198 | + * @return array |
|
199 | + */ |
|
200 | + public function getIssueLabelsInMilestone(int $number): array |
|
201 | + { |
|
202 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number/labels', |
|
203 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
204 | + } |
|
205 | 205 | } |
206 | 206 | \ No newline at end of file |
@@ -14,111 +14,111 @@ |
||
14 | 14 | class Milestones extends AbstractIssues |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * List milestones for a repository |
|
19 | - * |
|
20 | - * @link https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository |
|
21 | - * |
|
22 | - * @param string $state |
|
23 | - * @param string $sort |
|
24 | - * @param string $direction |
|
25 | - * |
|
26 | - * @return array |
|
27 | - */ |
|
28 | - public function listMilestones(string $state = AbstractApi::STATE_OPEN, string $sort = AbstractApi::SORT_DUE_DATE, |
|
29 | - string $direction = AbstractApi::DIRECTION_ASC): array |
|
30 | - { |
|
31 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones?:args', |
|
32 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), http_build_query([ |
|
33 | - 'state' => $state, |
|
34 | - 'sort' => $sort, |
|
35 | - 'direction' => $direction |
|
36 | - ]))); |
|
37 | - } |
|
17 | + /** |
|
18 | + * List milestones for a repository |
|
19 | + * |
|
20 | + * @link https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository |
|
21 | + * |
|
22 | + * @param string $state |
|
23 | + * @param string $sort |
|
24 | + * @param string $direction |
|
25 | + * |
|
26 | + * @return array |
|
27 | + */ |
|
28 | + public function listMilestones(string $state = AbstractApi::STATE_OPEN, string $sort = AbstractApi::SORT_DUE_DATE, |
|
29 | + string $direction = AbstractApi::DIRECTION_ASC): array |
|
30 | + { |
|
31 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones?:args', |
|
32 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), http_build_query([ |
|
33 | + 'state' => $state, |
|
34 | + 'sort' => $sort, |
|
35 | + 'direction' => $direction |
|
36 | + ]))); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * Get a single milestone |
|
41 | - * |
|
42 | - * @link https://developer.github.com/v3/issues/milestones/#get-a-single-milestone |
|
43 | - * |
|
44 | - * @param int $number |
|
45 | - * |
|
46 | - * @return array |
|
47 | - */ |
|
48 | - public function getMilestone(int $number): array |
|
49 | - { |
|
50 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number', |
|
51 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
52 | - } |
|
39 | + /** |
|
40 | + * Get a single milestone |
|
41 | + * |
|
42 | + * @link https://developer.github.com/v3/issues/milestones/#get-a-single-milestone |
|
43 | + * |
|
44 | + * @param int $number |
|
45 | + * |
|
46 | + * @return array |
|
47 | + */ |
|
48 | + public function getMilestone(int $number): array |
|
49 | + { |
|
50 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number', |
|
51 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number)); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Create a milestone |
|
56 | - * |
|
57 | - * @link https://developer.github.com/v3/issues/milestones/#create-a-milestone |
|
58 | - * |
|
59 | - * @param string $title |
|
60 | - * @param string $state |
|
61 | - * @param string $description |
|
62 | - * @param string $dueOn |
|
63 | - * |
|
64 | - * @return array |
|
65 | - */ |
|
66 | - public function createMilestone(string $title, string $state = AbstractApi::STATE_OPEN, string $description = '', |
|
67 | - string $dueOn = ''): array |
|
68 | - { |
|
69 | - return $this->getApi()->request($this->getApi() |
|
70 | - ->sprintf('/repos/:owner/:repo/milestones', $this->getIssues()->getOwner(), |
|
71 | - $this->getIssues()->getRepo()), Request::METHOD_POST, [ |
|
72 | - 'title' => $title, |
|
73 | - 'state' => $state, |
|
74 | - 'description' => $description, |
|
75 | - 'due_on' => (new DateTime($dueOn))->format(DateTime::ATOM) |
|
76 | - ]); |
|
77 | - } |
|
54 | + /** |
|
55 | + * Create a milestone |
|
56 | + * |
|
57 | + * @link https://developer.github.com/v3/issues/milestones/#create-a-milestone |
|
58 | + * |
|
59 | + * @param string $title |
|
60 | + * @param string $state |
|
61 | + * @param string $description |
|
62 | + * @param string $dueOn |
|
63 | + * |
|
64 | + * @return array |
|
65 | + */ |
|
66 | + public function createMilestone(string $title, string $state = AbstractApi::STATE_OPEN, string $description = '', |
|
67 | + string $dueOn = ''): array |
|
68 | + { |
|
69 | + return $this->getApi()->request($this->getApi() |
|
70 | + ->sprintf('/repos/:owner/:repo/milestones', $this->getIssues()->getOwner(), |
|
71 | + $this->getIssues()->getRepo()), Request::METHOD_POST, [ |
|
72 | + 'title' => $title, |
|
73 | + 'state' => $state, |
|
74 | + 'description' => $description, |
|
75 | + 'due_on' => (new DateTime($dueOn))->format(DateTime::ATOM) |
|
76 | + ]); |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * Update a milestone |
|
81 | - * |
|
82 | - * @link https://developer.github.com/v3/issues/milestones/#update-a-milestone |
|
83 | - * |
|
84 | - * @param int $number |
|
85 | - * @param string $title |
|
86 | - * @param string $state |
|
87 | - * @param string $description |
|
88 | - * @param string $dueOn |
|
89 | - * |
|
90 | - * @return array |
|
91 | - */ |
|
92 | - public function updateMilestone(int $number, string $title = '', string $state = AbstractApi::STATE_OPEN, |
|
93 | - string $description = '', string $dueOn = ''): array |
|
94 | - { |
|
95 | - return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number', |
|
96 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_PATCH, [ |
|
97 | - 'title' => $title, |
|
98 | - 'state' => $state, |
|
99 | - 'description' => $description, |
|
100 | - 'due_on' => (new DateTime($dueOn))->format(DateTime::ATOM) |
|
101 | - ]); |
|
102 | - } |
|
79 | + /** |
|
80 | + * Update a milestone |
|
81 | + * |
|
82 | + * @link https://developer.github.com/v3/issues/milestones/#update-a-milestone |
|
83 | + * |
|
84 | + * @param int $number |
|
85 | + * @param string $title |
|
86 | + * @param string $state |
|
87 | + * @param string $description |
|
88 | + * @param string $dueOn |
|
89 | + * |
|
90 | + * @return array |
|
91 | + */ |
|
92 | + public function updateMilestone(int $number, string $title = '', string $state = AbstractApi::STATE_OPEN, |
|
93 | + string $description = '', string $dueOn = ''): array |
|
94 | + { |
|
95 | + return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number', |
|
96 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_PATCH, [ |
|
97 | + 'title' => $title, |
|
98 | + 'state' => $state, |
|
99 | + 'description' => $description, |
|
100 | + 'due_on' => (new DateTime($dueOn))->format(DateTime::ATOM) |
|
101 | + ]); |
|
102 | + } |
|
103 | 103 | |
104 | - /** |
|
105 | - * Delete a milestone |
|
106 | - * |
|
107 | - * @link https://developer.github.com/v3/issues/milestones/#delete-a-milestone |
|
108 | - * |
|
109 | - * @param int $number |
|
110 | - * |
|
111 | - * @return bool |
|
112 | - */ |
|
113 | - public function deleteMilestone(int $number): bool |
|
114 | - { |
|
115 | - $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number', |
|
116 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_DELETE); |
|
104 | + /** |
|
105 | + * Delete a milestone |
|
106 | + * |
|
107 | + * @link https://developer.github.com/v3/issues/milestones/#delete-a-milestone |
|
108 | + * |
|
109 | + * @param int $number |
|
110 | + * |
|
111 | + * @return bool |
|
112 | + */ |
|
113 | + public function deleteMilestone(int $number): bool |
|
114 | + { |
|
115 | + $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/milestones/:number', |
|
116 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $number), Request::METHOD_DELETE); |
|
117 | 117 | |
118 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
119 | - return true; |
|
120 | - } |
|
118 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
119 | + return true; |
|
120 | + } |
|
121 | 121 | |
122 | - return false; |
|
123 | - } |
|
122 | + return false; |
|
123 | + } |
|
124 | 124 | } |
125 | 125 | \ No newline at end of file |
@@ -10,37 +10,37 @@ |
||
10 | 10 | class Assignees extends AbstractIssues |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * List assignees |
|
15 | - * |
|
16 | - * @link https://developer.github.com/v3/issues/assignees/#list-assignees |
|
17 | - * @return array |
|
18 | - */ |
|
19 | - public function listAssignees(): array |
|
20 | - { |
|
21 | - return $this->getApi()->request($this->getApi() |
|
22 | - ->sprintf('/repos/:owner/:repo/assignees', $this->getIssues()->getOwner(), |
|
23 | - $this->getIssues()->getRepo())); |
|
24 | - } |
|
13 | + /** |
|
14 | + * List assignees |
|
15 | + * |
|
16 | + * @link https://developer.github.com/v3/issues/assignees/#list-assignees |
|
17 | + * @return array |
|
18 | + */ |
|
19 | + public function listAssignees(): array |
|
20 | + { |
|
21 | + return $this->getApi()->request($this->getApi() |
|
22 | + ->sprintf('/repos/:owner/:repo/assignees', $this->getIssues()->getOwner(), |
|
23 | + $this->getIssues()->getRepo())); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Check assignee |
|
28 | - * |
|
29 | - * @link https://developer.github.com/v3/issues/assignees/#check-assignee |
|
30 | - * |
|
31 | - * @param string $assignee |
|
32 | - * |
|
33 | - * @return bool |
|
34 | - */ |
|
35 | - public function checkAssignee(string $assignee): bool |
|
36 | - { |
|
37 | - $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/assignees/:assignee', |
|
38 | - $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $assignee)); |
|
26 | + /** |
|
27 | + * Check assignee |
|
28 | + * |
|
29 | + * @link https://developer.github.com/v3/issues/assignees/#check-assignee |
|
30 | + * |
|
31 | + * @param string $assignee |
|
32 | + * |
|
33 | + * @return bool |
|
34 | + */ |
|
35 | + public function checkAssignee(string $assignee): bool |
|
36 | + { |
|
37 | + $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/assignees/:assignee', |
|
38 | + $this->getIssues()->getOwner(), $this->getIssues()->getRepo(), $assignee)); |
|
39 | 39 | |
40 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
41 | - return true; |
|
42 | - } |
|
40 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
41 | + return true; |
|
42 | + } |
|
43 | 43 | |
44 | - return false; |
|
45 | - } |
|
44 | + return false; |
|
45 | + } |
|
46 | 46 | } |
47 | 47 | \ No newline at end of file |
@@ -10,14 +10,14 @@ |
||
10 | 10 | class License extends AbstractEnterprise |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * Get license information |
|
15 | - * |
|
16 | - * @link https://developer.github.com/v3/enterprise/license/#get-license-information |
|
17 | - * @return array |
|
18 | - */ |
|
19 | - public function getLicenseInformation(): array |
|
20 | - { |
|
21 | - return $this->getApi()->request(sprintf('/enterprise/settings/license')); |
|
22 | - } |
|
13 | + /** |
|
14 | + * Get license information |
|
15 | + * |
|
16 | + * @link https://developer.github.com/v3/enterprise/license/#get-license-information |
|
17 | + * @return array |
|
18 | + */ |
|
19 | + public function getLicenseInformation(): array |
|
20 | + { |
|
21 | + return $this->getApi()->request(sprintf('/enterprise/settings/license')); |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -15,67 +15,67 @@ |
||
15 | 15 | class Ldap extends AbstractEnterprise |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * Update LDAP mapping for a user |
|
20 | - * |
|
21 | - * @link https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-user |
|
22 | - * |
|
23 | - * @param string $username |
|
24 | - * |
|
25 | - * @return array |
|
26 | - * @throws Exception |
|
27 | - */ |
|
28 | - public function updateMappingUser(string $username): array |
|
29 | - { |
|
30 | - return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/user/:username/mapping', $username), |
|
31 | - Request::METHOD_PATCH); |
|
32 | - } |
|
18 | + /** |
|
19 | + * Update LDAP mapping for a user |
|
20 | + * |
|
21 | + * @link https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-user |
|
22 | + * |
|
23 | + * @param string $username |
|
24 | + * |
|
25 | + * @return array |
|
26 | + * @throws Exception |
|
27 | + */ |
|
28 | + public function updateMappingUser(string $username): array |
|
29 | + { |
|
30 | + return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/user/:username/mapping', $username), |
|
31 | + Request::METHOD_PATCH); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * Sync LDAP mapping for a user |
|
36 | - * |
|
37 | - * @link https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user |
|
38 | - * |
|
39 | - * @param int $userId |
|
40 | - * |
|
41 | - * @return array |
|
42 | - * @throws Exception |
|
43 | - */ |
|
44 | - public function syncMappingUser(int $userId): array |
|
45 | - { |
|
46 | - return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/user/:user_id/sync', (string)$userId), |
|
47 | - Request::METHOD_POST); |
|
48 | - } |
|
34 | + /** |
|
35 | + * Sync LDAP mapping for a user |
|
36 | + * |
|
37 | + * @link https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-user |
|
38 | + * |
|
39 | + * @param int $userId |
|
40 | + * |
|
41 | + * @return array |
|
42 | + * @throws Exception |
|
43 | + */ |
|
44 | + public function syncMappingUser(int $userId): array |
|
45 | + { |
|
46 | + return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/user/:user_id/sync', (string)$userId), |
|
47 | + Request::METHOD_POST); |
|
48 | + } |
|
49 | 49 | |
50 | - /** |
|
51 | - * Update LDAP mapping for a team |
|
52 | - * |
|
53 | - * @link https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-team |
|
54 | - * |
|
55 | - * @param int $teamId |
|
56 | - * |
|
57 | - * @return array |
|
58 | - * @throws Exception |
|
59 | - */ |
|
60 | - public function updateMappingTeam(int $teamId): array |
|
61 | - { |
|
62 | - return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/teams/:team_id/mapping', (string)$teamId), |
|
63 | - Request::METHOD_PATCH); |
|
64 | - } |
|
50 | + /** |
|
51 | + * Update LDAP mapping for a team |
|
52 | + * |
|
53 | + * @link https://developer.github.com/v3/enterprise/ldap/#update-ldap-mapping-for-a-team |
|
54 | + * |
|
55 | + * @param int $teamId |
|
56 | + * |
|
57 | + * @return array |
|
58 | + * @throws Exception |
|
59 | + */ |
|
60 | + public function updateMappingTeam(int $teamId): array |
|
61 | + { |
|
62 | + return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/teams/:team_id/mapping', (string)$teamId), |
|
63 | + Request::METHOD_PATCH); |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * Sync LDAP mapping for a team |
|
68 | - * |
|
69 | - * @link https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team |
|
70 | - * |
|
71 | - * @param int $teamId |
|
72 | - * |
|
73 | - * @return array |
|
74 | - * @throws Exception |
|
75 | - */ |
|
76 | - public function syncMappingTeam(int $teamId): array |
|
77 | - { |
|
78 | - return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/teams/:team_id/sync', (string)$teamId), |
|
79 | - Request::METHOD_POST); |
|
80 | - } |
|
66 | + /** |
|
67 | + * Sync LDAP mapping for a team |
|
68 | + * |
|
69 | + * @link https://developer.github.com/v3/enterprise/ldap/#sync-ldap-mapping-for-a-team |
|
70 | + * |
|
71 | + * @param int $teamId |
|
72 | + * |
|
73 | + * @return array |
|
74 | + * @throws Exception |
|
75 | + */ |
|
76 | + public function syncMappingTeam(int $teamId): array |
|
77 | + { |
|
78 | + return $this->getApi()->request($this->getApi()->sprintf('/admin/ldap/teams/:team_id/sync', (string)$teamId), |
|
79 | + Request::METHOD_POST); |
|
80 | + } |
|
81 | 81 | } |
82 | 82 | \ No newline at end of file |