v1.2 #3

Manually merged
jhodges merged 25 commits from develop into master 2019-09-07 08:53:26 +01:00
Showing only changes of commit a6bb48ef96 - Show all commits

View File

@ -1,6 +1,8 @@
<?php
class Repo{
private $cache=[];
public function __construct(Client $client,$user,$repo){
$this->client=$client;
$this->user=$user;
@ -29,9 +31,12 @@ class Repo{
}
public function getLabelByName($name){
if(!$this->cache['lables']){
$url="repos/{$this->user}/{$this->repo}/labels";
$data=$this->client->request($url);
foreach($data as $datum){
$this->cache['lables']=$this->client->request($url);
}
foreach($this->cache['lables'] as $datum){
if($datum->name==$name){
$datum->url=$url."/".$datum->id; // not set by api for some reason (bug?)
return new Label($this,$datum);