File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 8
8
use Github \Api \Repository \Contents ;
9
9
use Github \Api \Repository \DeployKeys ;
10
10
use Github \Api \Repository \Downloads ;
11
+ use Github \Api \Repository \Releases ;
11
12
use Github \Api \Repository \Forks ;
12
13
use Github \Api \Repository \Hooks ;
13
14
use Github \Api \Repository \Labels ;
@@ -156,6 +157,17 @@ public function downloads()
156
157
return new Downloads ($ this ->client );
157
158
}
158
159
160
+ /**
161
+ * Manage the releases of a repository (Currently Undocumented)
162
+ * @link http://developer.github.com/v3/repos/
163
+ *
164
+ * @return Releases
165
+ */
166
+ public function releases ()
167
+ {
168
+ return new Releases ($ this ->client );
169
+ }
170
+
159
171
/**
160
172
* Manage the deploy keys of a repository
161
173
* @link http://developer.github.com/v3/repos/keys/
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Github \Api \Repository ;
4
+
5
+ use Github \Api \AbstractApi ;
6
+
7
+ /**
8
+ * @author Matthew Simo <[email protected] >
9
+ */
10
+ class Releases extends AbstractApi
11
+ {
12
+ /**
13
+ * List releases in selected repository
14
+ *
15
+ * @param string $username the user who owns the repo
16
+ * @param string $repository the name of the repo
17
+ *
18
+ * @return array
19
+ */
20
+ public function all ($ username , $ repository )
21
+ {
22
+ return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/releases ' );
23
+ }
24
+
25
+ /**
26
+ * Get a release in selected repository
27
+ *
28
+ * @param string $username the user who owns the repo
29
+ * @param string $repository the name of the repo
30
+ * @param integer $id the id of the release
31
+ *
32
+ * @return array
33
+ */
34
+ public function show ($ username , $ repository , $ id )
35
+ {
36
+ return $ this ->get ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/releases/ ' .urlencode ($ id ));
37
+ }
38
+
39
+ /**
40
+ * Delete a download in selected repository
41
+ *
42
+ * @param string $username the user who owns the repo
43
+ * @param string $repository the name of the repo
44
+ * @param integer $id the id of the release
45
+ *
46
+ * @return array
47
+ */
48
+ public function remove ($ username , $ repository , $ id )
49
+ {
50
+ return $ this ->delete ('repos/ ' .urlencode ($ username ).'/ ' .urlencode ($ repository ).'/releases/ ' .urlencode ($ id ));
51
+ }
52
+ }
You can’t perform that action at this time.
0 commit comments