Fragen\GitHub_Updater\GitHub_API::get_remote_branches PHP Метод

get_remote_branches() публичный Метод

Create array of branches and download links as array.
public get_remote_branches ( ) : boolean
Результат boolean
    public function get_remote_branches()
    {
        $branches = array();
        $response = isset($this->response['branches']) ? $this->response['branches'] : false;
        if ($this->exit_no_update($response, true)) {
            return false;
        }
        if (!$response) {
            $response = $this->api('/repos/:owner/:repo/branches');
            if ($response) {
                foreach ($response as $branch) {
                    $branches[$branch->name] = $this->construct_download_link(false, $branch->name);
                }
                $this->type->branches = $branches;
                $this->set_transient('branches', $branches);
                return true;
            }
        }
        if ($this->validate_response($response)) {
            return false;
        }
        $this->type->branches = $response;
        return true;
    }