Skip to content

Commit 5419b5e

Browse files
josephmancusoacrobat
authored andcommitted
Added repository documentation to current user (KnpLabs#671)
* created currentuser repositories documentation * Added code example to current users repo docs * changed email variable to repository variable * added parameter default and GitHub API link * added possible values
1 parent 719a37e commit 5419b5e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

doc/currentuser/repositories.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Current user / Repo API
2+
[Back to the navigation](../README.md)
3+
4+
> Requires [authentication](../security.md).
5+
6+
### List repositories that are accessible to the authenticated user.
7+
8+
```php
9+
$repositories = $client->currentUser()->repositories();
10+
```
11+
12+
This includes repositories owned by the authenticated user, repositories where the authenticated user is a collaborator, and repositories that the authenticated user has access to through an organization membership.
13+
14+
There are three values that can be passed into the `repositories` method: `type`, `sort` and `direction`
15+
16+
| Parameters | Default | Possible Values |
17+
| ------------- |-------------| -------------------------------------------- |
18+
| type | `owner` | `all`, `owner`, `public`, `private`, `member`
19+
| sort | `full_name` | `created`, `updated`, `pushed`, `full_name`
20+
| direction | `asc` | `asc`, `desc`
21+
22+
> See https://developer.github.com/v3/repos/#list-your-repositories for possible values and additional information
23+
24+
#### Code Example:
25+
26+
```php
27+
$client = new \Github\Client();
28+
$client->authenticate($github_token, null, \Github\Client::AUTH_HTTP_TOKEN);
29+
$client->currentUser()->repositories();
30+
```

0 commit comments

Comments
 (0)