GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Base   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 76.47%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 7
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 71
ccs 13
cts 17
cp 0.7647
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A GetUrl() 0 4 1
A SetUrl() 0 5 1
A GetClient() 0 4 1
A SetClient() 0 5 1
A request() 0 7 2
1
<?php
2
namespace Datatrics\API\Modules;
3
4
use Datatrics\API\Client;
5
6
class Base
7
{
8
    /**
9
     * @var string
10
     */
11
    public $url;
12
13
    /**
14
     * @var Client
15
     */
16
    public $client;
17
18
    /**
19
     * Base constructor.
20
     * @param Client $client
21
     */
22 16
    public function __construct($client)
23
    {
24 16
        $this->SetClient($client);
25 16
    }
26
27
    /**
28
     * @return string
29
     */
30 2
    public function GetUrl()
31
    {
32 2
        return $this->url;
33
    }
34
35
    /**
36
     * @param string $url
37
     * @return Base
38
     */
39 16
    public function SetUrl($url)
40
    {
41 16
        $this->url = $url;
42 16
        return $this;
43
    }
44
45
    /**
46
     * @return Client
47
     */
48 16
    public function GetClient()
49
    {
50 16
        return $this->client;
51
    }
52
53
    /**
54
     * @param Client $client
55
     * @return Base
56
     */
57 16
    public function SetClient($client)
58
    {
59 16
        $this->client = $client;
60 16
        return $this;
61
    }
62
63
    /**
64
     * @param $method
65
     * @param string $url
66
     * @param array $payload
67
     * @return mixed
68
     */
69
    public function request($method, $url = "", $payload = array())
70
    {
71
        if (empty($url)) {
72
            $url = $this->GetUrl();
73
        }
74
        return $this->GetClient()->SendRequest($method, $url, $payload);
75
    }
76
}
77