Additional APIs:
Lets you list pull requests for a given repository, list one pull request in particular along with its discussion, and create a pull-request. Wraps GitHub Pull Request API.
<?php
$openPullRequests = $client->api('pull_request')->all('ezsystems', 'ezpublish', array('state' => 'open'));
The state parameter of the listPullRequests method default to 'open'. The call above is equivalent to:
<?php
$openPullRequests = $client->api('pull_request')->all('ezsystems', 'ezpublish');
$openPullRequests
contains an array of open pull-requests for this repository.
<?php
$closedPullRequests = $client->api('pull_request')->all('ezsystems', 'ezpublish', array('state' => 'closed'));
$closedPullRequests
contains an array of closed pull-requests for this repository.
<?php
$pullRequest = $client->api('pull_request')->show('ezsystems', 'ezpublish', 15);
The last parameter of this call, Pull Request ID.
The $pullRequest
array contains the same elements as every entry in the result of a all()
call, plus a "discussion" key, self-explanatory.
A pull request can either be created by supplying both the Title & Body, OR an Issue ID.
Details regarding the content of parameters 3 and 4 of the create
.
You can create a draft pull request by adding a parameter with key draft
and value true
.
Requires authentication.
<?php
$pullRequest = $client->api('pull_request')->create('ezsystems', 'ezpublish', array(
'base' => 'master',
'head' => 'testbranch',
'title' => 'My nifty pull request',
'body' => 'This pull request contains a bunch of enhancements and bug-fixes, happily shared with you'
));
This returns the details of the pull request.
Requires authentication. The issue ID is provided instead of title and body.
<?php
$pullRequest = $client->api('pull_request')->create('ezsystems', 'ezpublish', array(
'base' => 'master',
'head' => 'testbranch',
'issue' => 15
));
This returns the details of the pull request.