當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。