tan-tan-kanarek / github-php-client

MIT License
184 stars 120 forks source link

Make GitHubContributor extend GitHubUser #28

Closed bennuttall closed 10 years ago

bennuttall commented 10 years ago

GitHubContributor should extend GitHubUser instead of just GitHubObject.

This means that you can access details about the contributor as a user, such as their username and avatar.

Currently all you can do is list the number of contributions:

$contributors = $client->repos->listContributors($user, $repo);

foreach ($contributors as $contributor) {
    echo $contributor->getContributions() . "<br>";
}

Whereas with the change you can access their user information too:

$contributors = $client->repos->listContributors($user, $repo);

foreach ($contributors as $contributor) {
    echo $contributor->getLogin() . ': ' . $contributor->getContributions() . "<br>";
}