From 824701c8940bb15e853f92fa0a0453c66a6965af Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 21 Sep 2014 17:02:05 +0100 Subject: [PATCH] Updated the docs for the latest version --- README.md | 16 ++++++++-------- src/GitHubManager.php | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4377ae9..cbe52d4 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,10 @@ Here you can see an example of just how simple this package is to use. Out of th use GrahamCampbell\GitHub\Facades\GitHub; // you can alias this in app/config/app.php if you like -GitHub::api('me')->organizations(); +GitHub::me()->organizations(); // we're done here - how easy was that, it just works! -GitHub::api('repo')->show('GrahamCampbell', 'Laravel-GitHub'); +GitHub::repo()->show('GrahamCampbell', 'Laravel-GitHub'); // this example is simple, and there are far more methods available ``` @@ -85,10 +85,10 @@ The github manager will behave like it is a `\GitHub\Client` class. If you want use GrahamCampbell\GitHub\Facades\GitHub; // the alternative connection is the other example provided in the default config -GitHub::connection('alternative')->api('me')->emails()->add('foo@bar.com'); +GitHub::connection('alternative')->me()->emails()->add('foo@bar.com'); // now we can see the new email address in the list of all the user's emails -GitHub::connection('alternative')->api('me')->emails()->all(); +GitHub::connection('alternative')->me()->emails()->all(); ``` With that in mind, note that: @@ -97,13 +97,13 @@ With that in mind, note that: use GrahamCampbell\GitHub\Facades\GitHub; // writing this: -GitHub::connection('main')->api('issues')->show('GrahamCampbell', 'Laravel-GitHub', 2); +GitHub::connection('main')->issues()->show('GrahamCampbell', 'Laravel-GitHub', 2); // is identical to writing this: -GitHub::api('issues')->show('GrahamCampbell', 'Laravel-GitHub', 2); +GitHub::issues()->show('GrahamCampbell', 'Laravel-GitHub', 2); // and is also identical to writing this: -GitHub::connection()->api('issues')->show('GrahamCampbell', 'Laravel-GitHub', 2); +GitHub::connection()->issues()->show('GrahamCampbell', 'Laravel-GitHub', 2); // this is because the main connection is configured to be the default GitHub::getDefaultConnection(); // this will return main @@ -129,7 +129,7 @@ class Foo public function bar() { - $this->github->api('issues')->show('GrahamCampbell', 'Laravel-GitHub', 2); + $this->github->issues()->show('GrahamCampbell', 'Laravel-GitHub', 2); } } diff --git a/src/GitHubManager.php b/src/GitHubManager.php index cf76467..d5d0546 100644 --- a/src/GitHubManager.php +++ b/src/GitHubManager.php @@ -23,6 +23,33 @@ /** * This is the github manager class. * + * @method \Github\Api\CurrentUser currentUser() + * @method \Github\Api\CurrentUser me() + * @method \Github\Api\Enterprise ent() + * @method \Github\Api\Enterprise enterprise() + * @method \Github\Api\GitData git() + * @method \Github\Api\GitData gitData() + * @method \Github\Api\Gists gist() + * @method \Github\Api\Gists gists() + * @method \Github\Api\Issue issue() + * @method \Github\Api\Issue issues() + * @method \Github\Api\Markdown markdown() + * @method \Github\Api\Organization organization() + * @method \Github\Api\Organization organizations() + * @method \Github\Api\PullRequest pr() + * @method \Github\Api\PullRequest pullRequest() + * @method \Github\Api\PullRequest pullRequests() + * @method \Github\Api\Repo repo() + * @method \Github\Api\Repo repos() + * @method \Github\Api\Repo repository() + * @method \Github\Api\Repo repositories() + * @method \Github\Api\Organization team() + * @method \Github\Api\Organization teams() + * @method \Github\Api\User user() + * @method \Github\Api\User users() + * @method \Github\Api\Authorizations authorization() + * @method \Github\Api\Authorizations authorizations() + * @method \Github\Api\Meta meta() * @method \Github\Api\ApiInterface api(string $name) * @method void authenticate(string $tokenOrLogin, string|null $password = null, string|null $authMethod = null) * @method void setEnterpriseUrl(string $enterpriseUrl)