当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::issue方法代码示例

本文整理汇总了PHP中Github\Client::issue方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::issue方法的具体用法?PHP Client::issue怎么用?PHP Client::issue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Github\Client的用法示例。


在下文中一共展示了Client::issue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createIssue

 /**
  * @param $ticketId
  * @param $repository
  * @param $assignee
  * @return bool
  * @throws \Zendesk\API\MissingParametersException
  * @throws \Zendesk\API\ResponseException
  * @internal param $ticket
  */
 public function createIssue($ticketId, $repository, $assignee)
 {
     $this->logger->debug(sprintf('entering issue creation for ticket #%s in repo %s', $ticketId, $repository));
     if ($this->isKnownTicket($ticketId)) {
         throw new \InvalidArgumentException('this ticket is already known, cant create twice');
     }
     try {
         $ticket = $this->zClient->ticket($ticketId)->find();
     } catch (\Exception $e) {
         $this->logger->error($this->zClient->getDebug()->lastResponseHeaders);
         return false;
     }
     if (!is_object($ticket->ticket)) {
         throw new \InvalidArgumentException('unable to find zendesk ticket with id ' . $ticketId);
     }
     try {
         $issueDatas = $this->formatIssueDatas($ticket->ticket, $assignee);
         $username = isset($this->config['github_organization']) ? $this->config['github_organization'] : $this->config['github_username'];
         $issue = $this->gClient->issue()->create($username, $repository, $issueDatas);
         if (isset($issue['number'])) {
             $this->updateTicketAfterIssueCreation($ticketId, $issue, $repository);
             $this->persistCreatedTicket($ticketId, $issue['number'], $repository);
             return true;
         } else {
             $this->logger->error('unable to find issue number from github payload');
             throw new \Exception('unable to find created issue Id');
         }
     } catch (\Exception $e) {
         $this->logger->error($e->getMessage());
         return false;
     }
 }
开发者ID:eliberty,项目名称:octocoupler,代码行数:41,代码来源:TicketProcessor.php

示例2: getIssues

 /**
  * {@inheritdoc}
  */
 public function getIssues(array $criteria = ['state' => 'open'])
 {
     list($username, $repo) = explode('/', $this->getName());
     $pager = new ResultPager($this->client);
     $issues = $pager->fetchAll($this->client->issue(), 'all', [$username, $repo, $criteria]);
     $newIssues = [];
     foreach ($issues as $issue) {
         $newIssues[] = new GithubIssue($issue);
     }
     return $newIssues;
 }
开发者ID:digitalkaoz,项目名称:issues,代码行数:14,代码来源:GithubProject.php

示例3: it_returns_Issue_objects_on_getIssues

 public function it_returns_Issue_objects_on_getIssues(Client $client, Issue $api, HttpClient $http, Response $response)
 {
     $client->issue()->willReturn($api);
     $client->getHttpClient()->willReturn($http);
     $api->getPerPage()->willReturn(5);
     $api->setPerPage(Argument::any())->willReturn();
     $http->getLastResponse()->willReturn($response);
     $response->getHeader('Link')->willReturn(null);
     $api->all('foo', 'bar', ['state' => 'open'])->willReturn([['number' => 1], ['number' => 5]]);
     $result = $this->getIssues();
     $result->shouldBeArray();
     $result->shouldHaveCount(2);
     $result[0]->shouldHaveType('Rs\\Issues\\Github\\GithubIssue');
     $result[0]->getId()->shouldBe(1);
     $result[1]->shouldHaveType('Rs\\Issues\\Github\\GithubIssue');
     $result[1]->getId()->shouldBe(5);
 }
开发者ID:digitalkaoz,项目名称:issues,代码行数:17,代码来源:GithubProjectSpec.php

示例4: deleteMilestone

 public function deleteMilestone($repository, $number)
 {
     $this->assertAuthenticated();
     $array = explode('/', $repository, 2);
     $this->github->issue()->milestones()->remove($array[0], $array[1], $number);
 }
开发者ID:CubeFree,项目名称:github-sync,代码行数:6,代码来源:Github.php


注:本文中的Github\Client::issue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。