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

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

Read the repository meta from API.
public get_repo_meta ( ) : boolean
Результат boolean
    public function get_repo_meta()
    {
        $response = isset($this->response['meta']) ? $this->response['meta'] : false;
        $response = !isset($response->items) ? $response : false;
        $repos = isset($this->response[$this->type->owner]) ? $this->response[$this->type->owner] : false;
        $meta_query = '?q=' . $this->type->repo . '+user:' . $this->type->owner;
        if (!$response) {
            $response = $this->api('/search/repositories' . $meta_query);
            $response = !empty($response->items[0]) ? $response->items[0] : false;
            if (!$repos) {
                $repos = $this->api('/users/' . $this->type->owner . '/repos');
                $repos = $this->parse_repos_response($repos);
                $this->set_transient($this->type->owner, $repos);
            }
            if (!$response) {
                foreach ($repos as $repo) {
                    if ($this->type->repo === $repo->name) {
                        $response = $repo;
                        break;
                    }
                }
            }
            if ($response) {
                $response = $this->parse_meta_response($response);
                $this->set_transient('meta', $response);
            }
        }
        if ($this->validate_response($response)) {
            return false;
        }
        $this->type->repo_meta = $response;
        $this->add_meta_repo_object();
        return true;
    }