$obj) { $this->repo[$key] = new Repos\Repo( sprintf("/repos/%s/%s", $obj->owner->username, $obj->name ), $this->token ); $this->repo[$key]->json_set_property($obj); } } public function current() { return current($this->repo); } public function next() { return next($this->repo); } public function reset() { return reset($this->repo); } public function __destruct() {} } } namespace Client\Request\Repos { class Repo extends \Client\Request\RequestBase { public $rid; public $rowner; public $rname; public $rfull_name; public $rdescription; public $rprivate; public $rfork; public $rparent; public $rempty; public $rmirror; public $rsize; public $rhtml_url; public $rssh_url; public $rclone_url; public $rwebsite; public $rstars_count; public $rforks_count; public $rwathcers_count; public $ropen_issues_count; public $rpublic_branch; public $rcreated_at; public $rupdated_at; public $rpermissions; public function __construct($api_url, $token) { if (!strpos($api_url, API_URL)) $api_url = sprintf("%s/%s", API_URL, $api_url); parent::__construct($api_url, $token); } protected function json_set_property($obj) { foreach($obj as $key => $value) { $key = 'r' . $key; if (property_exists($this, $key)) $this->{$key} = $value; } } public function __destruct() {} } }