Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -9,6 +9,13 @@ namespace Github\Api;
*/
class Apps extends AbstractApi
{
use AcceptHeaderTrait;
private function configurePreviewHeader()
{
$this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json';
}
/**
* Create an access token for an installation.
*
@@ -27,7 +34,9 @@ class Apps extends AbstractApi
$parameters['user_id'] = $userId;
}
return $this->post('/app/installations/'.rawurlencode($installationId).'/access_tokens', $parameters);
$this->configurePreviewHeader();
return $this->post('/app/installations/'.$installationId.'/access_tokens', $parameters);
}
/**
@@ -39,9 +48,90 @@ class Apps extends AbstractApi
*/
public function findInstallations()
{
$this->configurePreviewHeader();
return $this->get('/app/installations');
}
/**
* Get an installation of the application.
*
* @link https://developer.github.com/v3/apps/#get-an-installation
*
* @param int $installationId An integration installation id
*
* @return array
*/
public function getInstallation($installationId)
{
$this->configurePreviewHeader();
return $this->get('/app/installations/'.$installationId);
}
/**
* Get an installation of the application for an organization.
*
* @link https://developer.github.com/v3/apps/#get-an-organization-installation
*
* @param string $org An organization
*
* @return array
*/
public function getInstallationForOrganization($org)
{
$this->configurePreviewHeader();
return $this->get('/org/'.rawurldecode($org).'/installation');
}
/**
* Get an installation of the application for a repository.
*
* @link https://developer.github.com/v3/apps/#get-a-repository-installation
*
* @param string $owner the owner of a repository
* @param string $repo the name of the repository
*
* @return array
*/
public function getInstallationForRepo($owner, $repo)
{
$this->configurePreviewHeader();
return $this->get('/repos/'.rawurldecode($owner).'/'.rawurldecode($repo).'/installation');
}
/**
* Get an installation of the application for a user.
*
* @link https://developer.github.com/v3/apps/#get-a-user-installation
*
* @param string $username
*
* @return array
*/
public function getInstallationForUser($username)
{
$this->configurePreviewHeader();
return $this->get('/users/'.rawurldecode($username).'/installation');
}
/**
* Delete an installation of the application.
*
* @link https://developer.github.com/v3/apps/#delete-an-installation
*
* @param int $installationId An integration installation id
*/
public function removeInstallation($installationId)
{
$this->configurePreviewHeader();
$this->delete('/app/installations/'.$installationId);
}
/**
* List repositories that are accessible to the authenticated installation.
*
@@ -58,6 +148,8 @@ class Apps extends AbstractApi
$parameters['user_id'] = $userId;
}
$this->configurePreviewHeader();
return $this->get('/installation/repositories', $parameters);
}
@@ -73,7 +165,9 @@ class Apps extends AbstractApi
*/
public function addRepository($installationId, $repositoryId)
{
return $this->put('/installations/'.rawurlencode($installationId).'/repositories/'.rawurlencode($repositoryId));
$this->configurePreviewHeader();
return $this->put('/installations/'.$installationId.'/repositories/'.$repositoryId);
}
/**
@@ -88,6 +182,20 @@ class Apps extends AbstractApi
*/
public function removeRepository($installationId, $repositoryId)
{
return $this->delete('/installations/'.rawurlencode($installationId).'/repositories/'.rawurlencode($repositoryId));
$this->configurePreviewHeader();
return $this->delete('/installations/'.$installationId.'/repositories/'.$repositoryId);
}
/**
* Get the currently authenticated app.
*
* @link https://docs.github.com/en/rest/reference/apps#get-the-authenticated-app
*
* @return array
*/
public function getAuthenticatedApp()
{
return $this->get('/app');
}
}