File tree 2 files changed +30
-0
lines changed
lib/Github/Api/CurrentUser 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ $activity = $client->api('current_user')->starring()->all();
31
31
```
32
32
Returns an array of starred repos.
33
33
34
+ ### Get repos that a authenticated user has starred with creation date
35
+
36
+ Support for getting the star creation timestamp in the response, using the custom ` Accept: application/vnd.github.v3.star+json ` header.
37
+
38
+ ``` php
39
+ $activity = $client->api('current_user')->starring()->configure('star')->all();
40
+ ```
41
+ Returns an array of starred repos, including the ` created_at ` attribute for every star.
42
+
34
43
### Check if authenticated user has starred a specific repo
35
44
36
45
``` php
Original file line number Diff line number Diff line change 3
3
namespace Github \Api \CurrentUser ;
4
4
5
5
use Github \Api \AbstractApi ;
6
+ use Github \Api \AcceptHeaderTrait ;
6
7
7
8
/**
8
9
* @link https://developer.github.com/v3/activity/starring/
11
12
*/
12
13
class Starring extends AbstractApi
13
14
{
15
+ use AcceptHeaderTrait;
16
+
17
+ /**
18
+ * Configure the body type.
19
+ *
20
+ * @see https://developer.github.com/v3/activity/starring/#list-stargazers
21
+ *
22
+ * @param string $bodyType
23
+ *
24
+ * @return self
25
+ */
26
+ public function configure ($ bodyType = null )
27
+ {
28
+ if ('star ' === $ bodyType ) {
29
+ $ this ->acceptHeaderValue = sprintf ('application/vnd.github.%s.star+json ' , $ this ->client ->getApiVersion ());
30
+ }
31
+
32
+ return $ this ;
33
+ }
34
+
14
35
/**
15
36
* List repositories starred by the authenticated user.
16
37
*
You can’t perform that action at this time.
0 commit comments