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.

DigitalOceanResourceOwner::getEmailVerified()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace ChrisHemmings\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
6
7
class DigitalOceanResourceOwner implements ResourceOwnerInterface
8
{
9
    /**
10
     * Raw response
11
     *
12
     * @var
13
     */
14
    protected $response;
15
16
    /**
17
     * Creates new resource owner.
18
     *
19
     * @param $response
20
     */
21 3
    public function __construct($response)
22
    {
23 3
        $this->response = $response;
24 3
    }
25
26
    /**
27
     * Get resource owner id
28
     *
29
     * @return string|null
30
     */
31 3
    public function getId()
32
    {
33 3
        return $this->response['account']['uuid'] ?: null;
34
    }
35
36
    /**
37
     * Return all of the details available as an array.
38
     *
39
     * @return array
40
     */
41 3
    public function toArray()
42
    {
43 3
        return $this->response['account'];
44
    }
45
46
    /**
47
     * Get email
48
     *
49
     * @return string|null
50
     */
51 3
    public function getEmail()
52
    {
53 3
        return $this->response['account']['email'] ?: null;
54
    }
55
56
    /**
57
     * Get droplet limit
58
     *
59
     * @return string|null
60
     */
61 3
    public function getDropletLimit()
62
    {
63 3
        return $this->response['account']['droplet_limit'] ?: null;
64
    }
65
66
    /**
67
     * Get floating ip limit
68
     *
69
     * @return string|null
70
     */
71 3
    public function getFloatingIpLimit()
72
    {
73 3
        return $this->response['account']['floating_ip_limit'] ?: null;
74
    }
75
76
    /**
77
     * Get email verified status
78
     *
79
     * @return string|null
80
     */
81 3
    public function getEmailVerified()
82
    {
83 3
        return $this->response['account']['email_verified'] ?: null;
84
    }
85
86
    /**
87
     * Get account status
88
     *
89
     * @return string|null
90
     */
91 3
    public function getStatus()
92
    {
93 3
        return $this->response['account']['status'] ?: null;
94
    }
95
96
    /**
97
     * Get account status message
98
     *
99
     * @return string|null
100
     */
101 3
    public function getStatusMessage()
102
    {
103 3
        return $this->response['account']['status_message'] ?: null;
104
    }
105
}
106