From 8cb84274457546cff24b4837d0abeb30311ad8ca Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 8 May 2017 13:26:42 +0200 Subject: [PATCH 1/5] Add configure() --- lib/Github/Api/Integrations.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/Github/Api/Integrations.php b/lib/Github/Api/Integrations.php index ca797870e2a..a305cfb57a8 100644 --- a/lib/Github/Api/Integrations.php +++ b/lib/Github/Api/Integrations.php @@ -2,12 +2,31 @@ namespace Github\Api; +use Github\Api\AcceptHeaderTrait; + /** * @link https://developer.github.com/v3/integrations/ * @author Nils Adermann */ class Integrations extends AbstractApi { + use AcceptHeaderTrait; + + /** + * Configure the Accept header depending on the blob type. + * + * @param string|null $bodyType + * + * @return self + */ + public function configure($bodyType = null) + { + if ('raw' === $bodyType) { + $this->acceptHeaderValue = sprintf('application/vnd.github.%s.raw', $this->client->getApiVersion()); + } + return $this; + } + /** * Create an access token for an installation * From b304aae77ce7a464ea339027ed3160ceb9e919e3 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 8 May 2017 13:27:55 +0200 Subject: [PATCH 2/5] cs fixes --- lib/Github/Api/Integrations.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Github/Api/Integrations.php b/lib/Github/Api/Integrations.php index a305cfb57a8..7d087608018 100644 --- a/lib/Github/Api/Integrations.php +++ b/lib/Github/Api/Integrations.php @@ -24,6 +24,7 @@ public function configure($bodyType = null) if ('raw' === $bodyType) { $this->acceptHeaderValue = sprintf('application/vnd.github.%s.raw', $this->client->getApiVersion()); } + return $this; } From 96008623a91140d55d472ec84b98dcba5dae365f Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 8 May 2017 15:47:50 +0200 Subject: [PATCH 3/5] Hardcode header --- lib/Github/Api/Integrations.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/Github/Api/Integrations.php b/lib/Github/Api/Integrations.php index 7d087608018..df7db5b92a2 100644 --- a/lib/Github/Api/Integrations.php +++ b/lib/Github/Api/Integrations.php @@ -13,18 +13,15 @@ class Integrations extends AbstractApi use AcceptHeaderTrait; /** - * Configure the Accept header depending on the blob type. + * Configure the accept header for Early Access to the projects api * - * @param string|null $bodyType + * @see https://developer.github.com/v3/repos/projects/#projects * * @return self */ - public function configure($bodyType = null) + public function configure() { - if ('raw' === $bodyType) { - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.raw', $this->client->getApiVersion()); - } - + $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; return $this; } From 0f2c5d67e4999b4b8f1e7d1b2aeebf7572e63998 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 8 May 2017 15:48:40 +0200 Subject: [PATCH 4/5] cs fixes --- lib/Github/Api/Integrations.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Github/Api/Integrations.php b/lib/Github/Api/Integrations.php index df7db5b92a2..90aaf91f2d4 100644 --- a/lib/Github/Api/Integrations.php +++ b/lib/Github/Api/Integrations.php @@ -22,6 +22,7 @@ class Integrations extends AbstractApi public function configure() { $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; + return $this; } From c7905f49afe3f9735203962fd1c1417d0950220c Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Mon, 8 May 2017 16:25:40 +0200 Subject: [PATCH 5/5] Docblock fix --- lib/Github/Api/Integrations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Github/Api/Integrations.php b/lib/Github/Api/Integrations.php index 90aaf91f2d4..9cb801d699a 100644 --- a/lib/Github/Api/Integrations.php +++ b/lib/Github/Api/Integrations.php @@ -13,9 +13,9 @@ class Integrations extends AbstractApi use AcceptHeaderTrait; /** - * Configure the accept header for Early Access to the projects api + * Configure the accept header for Early Access to the integrations api * - * @see https://developer.github.com/v3/repos/projects/#projects + * @see https://developer.github.com/v3/integrations/ * * @return self */