本文整理汇总了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);
}