Access to Starring and Watching a Repository for [non] authenticated users. Wrap GitHub Activity API.
*** No authentication required. ***
$users = $client->api('user')->starred('ornicar');
Returns an array of starred repos.
$users = $client->api('user')->watched('ornicar');
Returns an array of watched repos.
*** Requires authentication. ***
$activity = $client->api('current_user')->starring()->all();
Returns an array of starred repos.
$activity = $client->api('user')->events('ornicar');
Returns an array of private and public events created for all repos related to the user.
Support for getting the star creation timestamp in the response, using the custom Accept: application/vnd.github.v3.star+json
header.
$activity = $client->api('current_user')->starring()->configure('star')->all();
Returns an array of starred repos, including the created_at
attribute for every star.
$owner = "KnpLabs";
$repo = "php-github-api";
$activity = $client->api('current_user')->starring()->check($owner, $repo);
Throws an Exception with code 404 in case that the repo is not starred by the authenticated user or NULL in case that it is starred by the authenticated user.
$owner = "KnpLabs";
$repo = "php-github-api";
$activity = $client->api('current_user')->starring()->star($owner, $repo);
Throws an Exception in case of failure or NULL in case of success.
$owner = "KnpLabs";
$repo = "php-github-api";
$activity = $client->api('current_user')->starring()->unstar($owner, $repo);
Throws an Exception in case of failure or NULL in case of success.
$activity = $client->api('current_user')->watchers()->all();
Returns an array of watched repos.
$owner = "KnpLabs";
$repo = "php-github-api";
$activity = $client->api('current_user')->watchers()->check($owner, $repo);
Throws an Exception with code 404 in case that the repo is not being watched by the authenticated user or NULL in case that it is being watched by the authenticated user.
$owner = "KnpLabs";
$repo = "php-github-api";
$activity = $client->api('current_user')->watchers()->watch($owner, $repo);
Throws an Exception in case of failure or NULL in case of success.
$owner = "KnpLabs";
$repo = "php-github-api";
$activity = $client->api('current_user')->watchers()->unwatch($owner, $repo);
Throws an Exception in case of failure or NULL in case of success.