本文整理匯總了PHP中Github\Client::repo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::repo方法的具體用法?PHP Client::repo怎麽用?PHP Client::repo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Github\Client
的用法示例。
在下文中一共展示了Client::repo方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateStatus
/**
* Set a SHA in GitHub to a state
*
* @param string $organisation
* @param string $repository
* @param GitHubMessage $message
*/
public function updateStatus(string $organisation, string $repository, GitHubMessage $message)
{
$status = $message->getHighestWeightStatus();
/** @var Repo $repoApi */
$repoApi = $this->client->repo();
/** @var Statuses $statusesApi */
$statusesApi = $repoApi->statuses();
$state = self::GITHUB_STATUS_SUCCESS;
if (!$status->isPositive()) {
$state = self::GITHUB_STATUS_FAILURE;
}
$statusesApi->create($organisation, $repository, $message->getSha(), ['state' => $state, 'description' => $status->getMessage(), 'context' => self::CONTEXT, 'target_url' => $status->getDetailsUrl()]);
}
示例2: let
public function let(Client $client, HookSettings $hookSettings, GithubRepo $githubRepo, Repo $repo, Hooks $hooks)
{
$githubRepo->getOwner()->willReturn('owner');
$githubRepo->getName()->willReturn('repository');
$client->repo()->willReturn($repo);
$repo->hooks()->willReturn($hooks);
$hookSettings->getCreateHookParams()->willReturn(['params']);
$this->beConstructedWith($client, $hookSettings, $githubRepo);
}
示例3: forkRepository
/**
* @param string $organization
* @param string $repositoryName
* @return \Guzzle\Http\EntityBodyInterface|mixed|string
*/
public function forkRepository($organization, $repositoryName)
{
$this->authenticate();
return $this->gitHubClient->repo()->forks()->create($organization, $repositoryName);
}