11## Issues / Labels API
2- [ Back to the "Issues API"] ( ../issues.md ) | [ Back to the navigation] ( index.md )
2+ [ Back to the "Issues API"] ( ../issues.md ) | [ Back to the navigation] ( ../ index.md)
33
44Wraps [ GitHub Issue Labels API] ( http://developer.github.com/v3/issues/labels/ ) .
55
66### List project labels
77
88``` php
9- <?php
10-
119$labels = $client->api('issue')->labels()->all('KnpLabs', 'php-github-api');
1210```
1311
@@ -16,12 +14,9 @@ Returns an array of project labels.
1614
1715### Add a label on an issue
1816
19- > Requires authentication.
17+ > Requires [ authentication] ( ../security.md ) .
2018
2119``` php
22- <?php
23-
24- $client->authenticate();
2520$labels = $client->api('issue')->labels()->add('KnpLabs', 'php-github-api', 4, 'label name');
2621```
2722
@@ -31,38 +26,29 @@ Returns an array of the issue labels.
3126
3227### Replace all labels for an issue
3328
34- > Requires authentication.
29+ > Requires [ authentication] ( ../security.md ) .
3530
3631``` php
37- <?php
38-
39- $client->authenticate();
4032$client->api('issue')->labels()->replace('KnpLabs', 'php-github-api', 4, array('new label name'));
4133```
4234
4335Replace a label for an issue: by username, repo, issue number and array of labels.
4436
4537### Remove all labels fom an issue
4638
47- > Requires authentication.
39+ > Requires [ authentication] ( ../security.md ) .
4840
4941``` php
50- <?php
51-
52- $client->authenticate();
5342$client->api('issue')->labels()->replace('KnpLabs', 'php-github-api', 4);
5443```
5544
5645Removal of all labels for the issue by username, repo, issue number.
5746
5847### Remove a label from an issue
5948
60- > Requires authentication.
49+ > Requires [ authentication] ( ../security.md ) .
6150
6251``` php
63- <?php
64-
65- $client->authenticate();
6652$client->api('issue')->labels()->remove('KnpLabs', 'php-github-api', 4, 'label name');
6753```
6854
0 commit comments