Compare commits
No commits in common. "develop" and "v1.2.0" have entirely different histories.
@ -4,19 +4,16 @@ namespace JHodges\GiteaBot;
|
|||||||
class GiteaData{
|
class GiteaData{
|
||||||
|
|
||||||
protected $data=null;
|
protected $data=null;
|
||||||
protected $newData=null;
|
|
||||||
|
|
||||||
public function __construct($data=null){
|
public function __construct($data=null){
|
||||||
$this->newData=new \stdClass();
|
|
||||||
if(!$data){
|
if(!$data){
|
||||||
$data=new \stdClass();
|
$data=new stdClass();
|
||||||
}
|
}
|
||||||
$this->data=$data;
|
$this->data=$data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __set($k,$v){
|
public function __set($k,$v){
|
||||||
$this->data->$k=$v;
|
$this->data->$k=$v;
|
||||||
$this->newData->$k=$v;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get($k){
|
public function __get($k){
|
||||||
|
@ -15,7 +15,7 @@ class GiteaRepoData extends GiteaData{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function save(){
|
public function save(){
|
||||||
return $this->repo->request($this->url,'PATCH',$this->newData);
|
return $this->repo->request($this->url,'PATCH',$this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
19
src/Repo.php
19
src/Repo.php
@ -32,25 +32,6 @@ 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