File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
lib/Github/Api/CurrentUser Expand file tree Collapse file tree 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();
3131```
3232Returns an array of starred repos.
3333
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+
3443### Check if authenticated user has starred a specific repo
3544
3645``` php
Original file line number Diff line number Diff line change 33namespace Github \Api \CurrentUser ;
44
55use Github \Api \AbstractApi ;
6+ use Github \Api \AcceptHeaderTrait ;
67
78/**
89 * @link https://developer.github.com/v3/activity/starring/
1112 */
1213class Starring extends AbstractApi
1314{
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+
1435 /**
1536 * List repositories starred by the authenticated user.
1637 *
You can’t perform that action at this time.
0 commit comments