Skip to content

Commit d66c81e

Browse files
committed
The Merge methods API is now official
see: https://developer.github.com/changes/2017-04-07-end-merge-methods-api-preview/ this removes the apiVersion (that wasn't being used anyway..) also adds support for rebase mergeMethod per https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button Since this previously looked for the value to be bool, this is a breaking change
1 parent 8c5d3bb commit d66c81e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/Github/Api/PullRequest.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,11 @@ class PullRequest extends AbstractApi
2222
*
2323
* @link https://developer.github.com/v3/pulls/#custom-media-types
2424
* @param string|null $bodyType
25-
* @param string|null $apiVersion
2625
*
2726
* @return self
2827
*/
29-
public function configure($bodyType = null, $apiVersion = null)
28+
public function configure($bodyType = null)
3029
{
31-
if (!in_array($apiVersion, array('polaris-preview'))) {
32-
$apiVersion = $this->client->getApiVersion();
33-
}
34-
3530
if (!in_array($bodyType, array('text', 'html', 'full', 'diff', 'patch'))) {
3631
$bodyType = 'raw';
3732
}
@@ -159,8 +154,8 @@ public function merged($username, $repository, $id)
159154

160155
public function merge($username, $repository, $id, $message, $sha, $mergeMethod = 'merge', $title = null)
161156
{
162-
if (is_bool($mergeMethod)) {
163-
$mergeMethod = $mergeMethod ? 'squash' : 'merge';
157+
if (!in_array($mergeMethod, array('squash', 'rebase'))) {
158+
$mergeMethod = 'merge';
164159
}
165160

166161
$params = array(

0 commit comments

Comments
 (0)