Skip to content

Commit 2ab07f3

Browse files
author
Pawel Luczkiewicz
committed
Change to the old way of setting headers
1 parent d311068 commit 2ab07f3

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

lib/Github/Api/Repository/Checks/CheckRuns.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,15 @@ class CheckRuns extends AbstractApi
1212
{
1313
use AcceptHeaderTrait;
1414

15-
public function configure()
16-
{
17-
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
18-
19-
return $this;
20-
}
21-
2215
/**
2316
* @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-run
2417
*
2518
* @return array
2619
*/
2720
public function create(string $username, string $repository, array $params = [])
2821
{
22+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
23+
2924
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs', $params);
3025
}
3126

@@ -36,6 +31,8 @@ public function create(string $username, string $repository, array $params = [])
3631
*/
3732
public function show(string $username, string $repository, int $checkRunId)
3833
{
34+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
35+
3936
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId);
4037
}
4138

@@ -46,6 +43,8 @@ public function show(string $username, string $repository, int $checkRunId)
4643
*/
4744
public function update(string $username, string $repository, int $checkRunId, array $params = [])
4845
{
46+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
47+
4948
return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId, $params);
5049
}
5150

@@ -56,6 +55,8 @@ public function update(string $username, string $repository, int $checkRunId, ar
5655
*/
5756
public function annotations(string $username, string $repository, int $checkRunId)
5857
{
58+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
59+
5960
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId.'/annotations');
6061
}
6162

@@ -66,6 +67,8 @@ public function annotations(string $username, string $repository, int $checkRunI
6667
*/
6768
public function allForCheckSuite(string $username, string $repository, int $checkSuiteId, array $params = [])
6869
{
70+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
71+
6972
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/check-runs', $params);
7073
}
7174

@@ -76,6 +79,8 @@ public function allForCheckSuite(string $username, string $repository, int $chec
7679
*/
7780
public function allForReference(string $username, string $repository, string $ref, array $params = [])
7881
{
82+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
83+
7984
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-runs', $params);
8085
}
8186
}

lib/Github/Api/Repository/Checks/CheckSuites.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,15 @@ class CheckSuites extends AbstractApi
1212
{
1313
use AcceptHeaderTrait;
1414

15-
public function configure()
16-
{
17-
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
18-
19-
return $this;
20-
}
21-
2215
/**
2316
* @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-suite
2417
*
2518
* @return array
2619
*/
2720
public function create(string $username, string $repository, array $params = [])
2821
{
22+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
23+
2924
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites', $params);
3025
}
3126

@@ -36,6 +31,8 @@ public function create(string $username, string $repository, array $params = [])
3631
*/
3732
public function updatePreferences(string $username, string $repository, array $params = [])
3833
{
34+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
35+
3936
return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/preferences', $params);
4037
}
4138

@@ -46,6 +43,8 @@ public function updatePreferences(string $username, string $repository, array $p
4643
*/
4744
public function getCheckSuite(string $username, string $repository, int $checkSuiteId)
4845
{
46+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
47+
4948
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId);
5049
}
5150

@@ -56,6 +55,8 @@ public function getCheckSuite(string $username, string $repository, int $checkSu
5655
*/
5756
public function rerequest(string $username, string $repository, int $checkSuiteId)
5857
{
58+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
59+
5960
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/rerequest');
6061
}
6162

@@ -66,6 +67,8 @@ public function rerequest(string $username, string $repository, int $checkSuiteI
6667
*/
6768
public function allForReference(string $username, string $repository, string $ref, array $params = [])
6869
{
70+
$this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json';
71+
6972
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-suites', $params);
7073
}
7174
}

0 commit comments

Comments
 (0)