Skip to content

Commit 38bd1a4

Browse files
committed
add back in $apiVersion to make it easier to handle preview versions in the future
there are no preview versions now so checking against an empty array also had to fix the acceptHeaderValue to correctly use the variable
1 parent 5045173 commit 38bd1a4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/Github/Api/PullRequest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ 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
2526
*
2627
* @return self
2728
*/
28-
public function configure($bodyType = null)
29+
public function configure($bodyType = null, $apiVersion = null)
2930
{
31+
if (!in_array($apiVersion, array())) {
32+
$apiVersion = $this->client->getApiVersion();
33+
}
34+
3035
if (!in_array($bodyType, array('text', 'html', 'full', 'diff', 'patch'))) {
3136
$bodyType = 'raw';
3237
}
@@ -35,7 +40,7 @@ public function configure($bodyType = null)
3540
$bodyType .= '+json';
3641
}
3742

38-
$this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $this->client->getApiVersion(), $bodyType);
43+
$this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $apiVersion, $bodyType);
3944

4045
return $this;
4146
}

0 commit comments

Comments
 (0)