Activity API (incomplete)

Back to the navigation

Access to Starring and Watching a Repository for [non] authenticated users. Wrap GitHub Activity API.

No authentication required.

Get repos that a specific user has starred

$users = $client->api('user')->starred('ornicar');

Returns an array of starred repos.

Get repos that a specific user is watching

$users = $client->api('user')->watched('ornicar');

Returns an array of watched repos.

Requires authentication.

Get repos that a authenticated user has starred

$activity = $client->api('current_user')->starring()->all();

Returns an array of starred repos.

Check if authenticated user has starred a specific repo

$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.

Star a specific repo for 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.

Unstar a specific repo for authenticated user

$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.

Get repos that a authenticated user is watching

$activity = $client->api('current_user')->watchers()->all();

Returns an array of watched repos.

Check if authenticated user is watching a specific repo

$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 beeing watched by the authenticated user or NULL in case that it is beeing watched by the authenticated user.

Watch a specific repo for 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.

Stop watching a specific repo for authenticated user

$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.