yet another github api refactoring
[pharext/pharext.org] / app / Github / API / Tags / TagsCallback.php
1 <?php
2
3 namespace app\Github\API\Tags;
4
5 use app\Github\API;
6 use app\Github\API\Callback;
7
8 class TagsCallback extends Callback
9 {
10 private $repo;
11
12 function __construct(API $api, $repo) {
13 parent::__construct($api);
14 $this->repo = $repo;
15 }
16
17 function __invoke($json, $links = null) {
18 settype($this->repo->tags, "object");
19 foreach ($json as $tag) {
20 $name = $tag->name;
21 settype($this->repo->tags->$name, "object");
22 $this->repo->tags->$name->tag = $tag;
23 }
24 }
25 }