add getIssues (#1)
This commit is contained in:
parent
cd79454aa7
commit
fe713f6926
19
src/Repo.php
19
src/Repo.php
@ -32,6 +32,25 @@ class Repo{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getIssues($args=null){
|
||||||
|
$page=1;
|
||||||
|
$all_issues=[];
|
||||||
|
while(1){
|
||||||
|
$url="repos/{$this->user}/{$this->repo}/issues?page=$page";
|
||||||
|
if($args){
|
||||||
|
$url.='&'.http_build_query($args);
|
||||||
|
}
|
||||||
|
$issues=$this->client->request($url);
|
||||||
|
foreach($issues as $data){
|
||||||
|
$issue=new Issue($this,$data);
|
||||||
|
$all_issues[]=$issue;
|
||||||
|
}
|
||||||
|
if(!$issues) break;
|
||||||
|
$page++;
|
||||||
|
}
|
||||||
|
return $all_issues;
|
||||||
|
}
|
||||||
|
|
||||||
public function getLabelByName($name){
|
public function getLabelByName($name){
|
||||||
$url="repos/{$this->user}/{$this->repo}/labels";
|
$url="repos/{$this->user}/{$this->repo}/labels";
|
||||||
if(!isset($this->cache['lables'])){
|
if(!isset($this->cache['lables'])){
|
||||||
|
Loading…
Reference in New Issue
Block a user