protected function add_endpoints($git, $endpoint)
{
switch (self::$method) {
case 'projects':
case 'meta':
case 'tags':
break;
case 'file':
case 'changes':
case 'readme':
$endpoint = add_query_arg('ref', $git->type->branch, $endpoint);
break;
case 'translation':
$endpoint = add_query_arg('ref', 'master', $endpoint);
break;
default:
break;
}
$endpoint = $this->add_access_token_endpoint($git, $endpoint);
/*
* If using GitLab CE/Enterprise header return this endpoint.
*/
if (!empty($git->type->enterprise_api)) {
return $git->type->enterprise_api . $endpoint;
}
return $endpoint;
}