Fragen\GitHub_Updater\GitLab_API::get_gitlab_id PHP Метод

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

Get GitLab project ID and project meta.
public get_gitlab_id ( ) : string | integer
Результат string | integer
    public function get_gitlab_id()
    {
        $id = null;
        $response = isset($this->response['project_id']) ? $this->response['project_id'] : false;
        if (!$response) {
            self::$method = 'projects';
            $response = $this->api('/projects?per_page=100');
            foreach ((array) $response as $project) {
                if ($this->type->repo === $project->path) {
                    $id = $project->id;
                    $this->set_transient('project_id', $id);
                    $this->set_transient('project', $project);
                    return $id;
                }
            }
            if (empty($response)) {
                $id = urlencode($this->type->owner . '/' . $this->type->repo);
                return $id;
            }
        }
        return $response;
    }