Skip to content

Commit

Permalink
Updated the docs for the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Sep 21, 2014
1 parent 17fc705 commit 824701c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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('[email protected]');
GitHub::connection('alternative')->me()->emails()->add('[email protected]');

// 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:
Expand All @@ -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
Expand All @@ -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);
}
}

Expand Down
27 changes: 27 additions & 0 deletions src/GitHubManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 824701c

Please sign in to comment.