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.
Completed
Push — 2.0 ( 5e7ce8...036b94 )
by Nico
06:29
created

Base   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 94.12%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 7
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 65
ccs 16
cts 17
cp 0.9412
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 11
    public function __construct($client)
23
    {
24 11
        $this->SetClient($client);
25 11
    }
26
27
    /**
28
     * @return string
29
     */
30 6
    public function GetUrl()
31
    {
32 6
        return $this->url;
33
    }
34
35
    /**
36
     * @param string $url
37
     * @return Base
38
     */
39 11
    public function SetUrl($url)
40
    {
41 11
        $this->url = $url;
42 11
        return $this;
43
    }
44
45
    /**
46
     * @return Client
47
     */
48 11
    public function GetClient()
49
    {
50 11
        return $this->client;
51
    }
52
53
    /**
54
     * @param Client $client
55
     * @return Base
56
     */
57 11
    public function SetClient($client)
58
    {
59 11
        $this->client = $client;
60 11
        return $this;
61
    }
62
63 4
    public function request($method, $url = "", $payload = [])
64
    {
65 4
        if (empty($url)) {
66
            $url = $this->GetUrl();
67
        }
68 4
        return $this->GetClient()->SendRequest($method, $url, $payload);
69
    }
70
}
71