tan-tan-kanarek / github-php-client

MIT License
184 stars 120 forks source link

Pull-Request: Add property labels to github issue object #143

Closed ff1601com closed 3 years ago

ff1601com commented 3 years ago

Hello again,

I found it to be very useful to get the labels assigned to the issues when requesting them. Previously I had to do a workaround which basically did double the amount of api-calls.

It was something along the lines of:

//get all issues assigned to authenticated user
$issues = $this->client->issues->listAllIssues();

//regex the repository out of the getUrl()
$repoName = preg_match($issue->getUrl(), ...);

//make another api call to list the labels on the issue
$this->client->issues->labels->listLabelsOnAnIssue($orga, $repoName, $issue->getNumber();

With the changes of the pull-request one could basically get all the needed informations about the labels when requesting the issues and does not have to make another api call.

Could you please merge this changes?

Thanks in advance!