Skip to content

Added header for apps #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 1, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Function rename and made final
  • Loading branch information
AAllport authored Nov 1, 2019
commit 31b69eaed78267dd1930412c30cdb7bd0184e74a
14 changes: 6 additions & 8 deletions lib/Github/Api/Apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ class Apps extends AbstractApi
{
use AcceptHeaderTrait;

public function configure()
final public function configurePreviewHeader()
{
$this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json';

return $this;
}

/**
Expand All @@ -36,7 +34,7 @@ public function createInstallationToken($installationId, $userId = null)
$parameters['user_id'] = $userId;
}

$this->configure();
$this->configurePreviewHeader();

return $this->post('/app/installations/'.rawurlencode($installationId).'/access_tokens', $parameters);
}
Expand All @@ -50,7 +48,7 @@ public function createInstallationToken($installationId, $userId = null)
*/
public function findInstallations()
{
$this->configure();
$this->configurePreviewHeader();

return $this->get('/app/installations');
}
Expand All @@ -71,7 +69,7 @@ public function listRepositories($userId = null)
$parameters['user_id'] = $userId;
}

$this->configure();
$this->configurePreviewHeader();

return $this->get('/installation/repositories', $parameters);
}
Expand All @@ -88,7 +86,7 @@ public function listRepositories($userId = null)
*/
public function addRepository($installationId, $repositoryId)
{
$this->configure();
$this->configurePreviewHeader();

return $this->put('/installations/'.rawurlencode($installationId).'/repositories/'.rawurlencode($repositoryId));
}
Expand All @@ -105,7 +103,7 @@ public function addRepository($installationId, $repositoryId)
*/
public function removeRepository($installationId, $repositoryId)
{
$this->configure();
$this->configurePreviewHeader();

return $this->delete('/installations/'.rawurlencode($installationId).'/repositories/'.rawurlencode($repositoryId));
}
Expand Down