3 namespace app\Github\API\Repos
;
6 use app\Github\API\Callback
;
8 class ReleasesCallback
extends Callback
12 function __construct(API
$api, $repo) {
13 parent
::__construct($api);
17 function __invoke($json, $links = null) {
18 settype($this->repo
->tags
, "object");
19 foreach ($json as $release) {
20 $tag = $release->tag_name
;
21 settype($this->repo
->tags
->$tag, "object");
22 $this->repo
->tags
->$tag->release
= $release;
23 $this->api
->listReleaseAssets($this->repo
->full_name
, $release->id
, function($assets) use($release) {
24 $release->assets
= $assets;