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 ( 7432a9...1e0a4c )
by Nico
02:51
created

Base::SetUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
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 20
    public function __construct($client)
23
    {
24 20
        $this->SetClient($client);
25 20
    }
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 20
    public function SetUrl($url)
40
    {
41 20
        $this->url = $url;
42 20
        return $this;
43
    }
44
45
    /**
46
     * @return Client
47
     */
48 20
    public function GetClient()
49
    {
50 20
        return $this->client;
51
    }
52
53
    /**
54
     * @param Client $client
55
     * @return Base
56
     */
57 20
    public function SetClient($client)
58
    {
59 20
        $this->client = $client;
60 20
        return $this;
61
    }
62
63
    public function request($method, $url = "", $payload = [])
64
    {
65
        if (empty($url)) {
66
            $url = $this->GetUrl();
67
        }
68
        return $this->GetClient()->SendRequest($method, $url, $payload);
69
    }
70
}
71