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.

Human   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 53
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAccessToken() 0 4 1
A get() 0 12 2
1
<?php
2
3
namespace Choccybiccy\HumanApi;
4
5
/**
6
 * Class Human
7
 * @package Choccybiccy\HumanApi
8
 */
9
class Human
10
{
11
12
    /**
13
     * @var string
14
     */
15
    protected $accessToken;
16
17
    /**
18
     * @var Client
19
     */
20
    protected $client;
21
22
    /**
23
     * Constructor
24
     *
25
     * @param string $accessToken
26
     */
27
    public function __construct($accessToken)
28
    {
29
        $this->accessToken = $accessToken;
30
    }
31
32
    /**
33
     * Get access token
34
     *
35
     * @return string
36
     */
37
    public function getAccessToken()
38
    {
39
        return $this->accessToken;
40
    }
41
42
    /**
43
     * Get endpoint
44
     *
45
     * @param string $endpoint
46
     * @return Endpoint
47
     * @codeCoverageIgnore
48
     */
49
    public function get($endpoint)
50
    {
51
        $endpoint = "\\Choccybiccy\\HumanApi\\Endpoint\\" . ucfirst($endpoint);
52
        if (class_exists($endpoint)) {
53
            /** @var Endpoint $endpoint */
54
            $endpoint = new $endpoint;
55
            $endpoint->setAccessToken($this->accessToken);
56
57
            return $endpoint;
58
59
        }
60
    }
61
}
62