Gitlab   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConnection() 0 14 2
1
<?php
2
3
namespace Integrations\Connectors\Gitlab;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Log;
7
use App\Models\User;
8
use Integrations\Connectors\Connector;
9
10
class Gitlab extends Connector
11
{
12
    public static $ID = 4;
13
    protected function getConnection($token = false)
14
    {
15
        $url = 'http://gitlab.com/';
16
        if (!empty($token->account->customize_url)) {
17
            $url = $token->account->customize_url;
18
        }
19
20
        // return \Gitlab\Client::create($url)
21
        // ->authenticate($token->token, \Gitlab\Client::AUTH_URL_TOKEN);
22
23
        // or for OAuth2 (see https://github.com/m4tthumphrey/php-gitlab-api/blob/master/lib/Gitlab/HttpClient/Plugin/Authentication.php#L47)
24
        return \Gitlab\Client::create($url)
0 ignored issues
show
Bug introduced by
The method create() does not exist on Gitlab\Client. Did you maybe mean createWithHttpClient()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
25
            ->authenticate($token->token, \Gitlab\Client::AUTH_OAUTH_TOKEN);
26
    }
27
}
28