File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 10
10
*/
11
11
class Comments extends AbstractApi
12
12
{
13
+ /**
14
+ * Get all comments for a gist.
15
+ *
16
+ * @param string $gist
17
+ *
18
+ * @return array
19
+ */
13
20
public function all ($ gist )
14
21
{
15
22
return $ this ->get ('gists/ ' .rawurlencode ($ gist ).'/comments ' );
16
23
}
17
24
25
+ /**
26
+ * Get a comment of a gist.
27
+ *
28
+ * @param string $gist
29
+ * @param int $comment
30
+ *
31
+ * @return array
32
+ */
18
33
public function show ($ gist , $ comment )
19
34
{
20
35
return $ this ->get ('gists/ ' .rawurlencode ($ gist ).'/comments/ ' .rawurlencode ($ comment ));
21
36
}
22
37
38
+ /**
39
+ * Create a comment for gist.
40
+ *
41
+ * @param string $gist
42
+ * @param string $body
43
+ *
44
+ * @return array
45
+ */
23
46
public function create ($ gist , $ body )
24
47
{
25
48
return $ this ->post ('gists/ ' .rawurlencode ($ gist ).'/comments ' , array ('body ' => $ body ));
26
49
}
27
50
51
+ /**
52
+ * Create a comment for a gist.
53
+ *
54
+ * @param string $gist
55
+ * @param int $comment_id
56
+ * @param string $body
57
+ *
58
+ * @return array
59
+ */
28
60
public function update ($ gist , $ comment_id , $ body )
29
61
{
30
62
return $ this ->patch ('gists/ ' .rawurlencode ($ gist ).'/comments/ ' .rawurlencode ($ comment_id ), array ('body ' => $ body ));
31
63
}
32
64
65
+ /**
66
+ * Delete a comment for a gist.
67
+ *
68
+ * @param string $gist
69
+ * @param int $comment
70
+ *
71
+ * @return array
72
+ */
33
73
public function remove ($ gist , $ comment )
34
74
{
35
75
return $ this ->delete ('gists/ ' .rawurlencode ($ gist ).'/comments/ ' .rawurlencode ($ comment ));
You can’t perform that action at this time.
0 commit comments