Skip to content

Commit 1c77846

Browse files
Clarify README examples
1 parent 2412ac9 commit 1c77846

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ We are decoupled from any HTTP messaging client by using [PSR-7](https://www.php
5050
## General API Usage
5151

5252
```php
53-
// Token authentication
5453
$client = new Gitlab\Client();
55-
$client->authenticate('your_http_token', Gitlab\Client::AUTH_HTTP_TOKEN);
54+
55+
// Choose one authentication method.
56+
57+
// Personal access token authentication
58+
$client->authenticate('your_access_token', Gitlab\Client::AUTH_HTTP_TOKEN);
5659

5760
// OAuth2 authentication
58-
$client = new Gitlab\Client();
59-
$client->authenticate('your_oauth_token', Gitlab\Client::AUTH_OAUTH_TOKEN);
61+
// $client->authenticate('your_oauth_token', Gitlab\Client::AUTH_OAUTH_TOKEN);
6062

6163
// An example API call
6264
$project = $client->projects()->create('My Project', [
6365
'description' => 'This is a project',
64-
'issues_enabled' => false,
66+
'issues_access_level' => 'disabled',
6567
]);
6668
```
6769

@@ -70,7 +72,7 @@ $project = $client->projects()->create('My Project', [
7072
```php
7173
$client = new Gitlab\Client();
7274
$client->setUrl('https://git.yourdomain.com');
73-
$client->authenticate('your_http_token', Gitlab\Client::AUTH_HTTP_TOKEN);
75+
$client->authenticate('your_access_token', Gitlab\Client::AUTH_HTTP_TOKEN);
7476
```
7577

7678
### Example with Pager
@@ -95,7 +97,7 @@ $builder->addPlugin($plugin);
9597
$client = new Gitlab\Client($builder);
9698
```
9799

98-
One can read more about HTTPlug plugins [here](https://docs.php-http.org/en/latest/plugins/introduction.html#how-it-works). Take a look around the [API methods](https://github.com/GitLabPHP/Client/tree/12.0/src/Api), and please feel free to report any bugs, noting our [code of conduct](.github/CODE_OF_CONDUCT.md).
100+
One can read more about HTTPlug plugins [here](https://docs.php-http.org/en/latest/plugins/introduction.html#how-it-works). Take a look around the [API methods](https://github.com/GitLabPHP/Client/tree/12.1/src/Api), and please feel free to report any bugs, noting our [code of conduct](.github/CODE_OF_CONDUCT.md).
99101

100102

101103
## Contributing

0 commit comments

Comments
 (0)