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 — master ( bce9ad...5c78c2 )
by Joan
11:47
created

DiscordResourceOwner::getAvatarHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of the wohali/oauth2-discord-new library
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright Copyright (c) Joan Touzet <[email protected]>
9
 * @license http://opensource.org/licenses/MIT MIT
10
 * @link https://packagist.org/packages/wohali/oauth2-discord-new Packagist
11
 * @link https://github.com/wohali/oauth2-discord-new GitHub
12
 */
13
14
namespace Wohali\OAuth2\Client\Provider;
15
16
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
17
18
class DiscordResourceOwner implements ResourceOwnerInterface
19
{
20
    use ArrayAccessorTrait;
21
22
    /**
23
     * Raw response
24
     *
25
     * @var array
26
     */
27
    protected $response;
28
29
    /**
30
     * Creates new resource owner.
31
     *
32
     * @param array  $response
33
     */
34 3
    public function __construct(array $response = array())
35
    {
36 3
        $this->response = $response;
37 3
    }
38
39
    /**
40
     * Get resource owner ID
41
     *
42
     * @return string|null
43
     */
44 3
    public function getId()
45
    {
46 3
        return $this->getValueByKey($this->response, 'id');
47
    }
48
49
    /**
50
     * Get resource owner username
51
     *
52
     * @return string|null
53
     */
54 3
    public function getUsername()
55
    {
56 3
        return $this->getValueByKey($this->response, 'username');
57
    }
58
59
    /**
60
     * Get resource owner discriminator
61
     *
62
     * @return string|null
63
     */
64 3
    public function getDiscriminator()
65
    {
66 3
        return $this->getValueByKey($this->response, 'discriminator');
67
    }
68
69
    /**
70
     * Get resource owner avatar hash
71
     *
72
     * @return string|null
73
     */
74 3
    public function getAvatarHash()
75
    {
76 3
        return $this->getValueByKey($this->response, 'avatar');
77
    }
78
79
    /**
80
     * Get resource owner verified flag
81
     *
82
     * @return bool
83
     */
84 3
    public function getVerified()
85
    {
86 3
        return $this->getValueByKey($this->response, 'verified', false);
87
    }
88
89
    /**
90
     * Get resource owner email
91
     *
92
     * @return string|null
93
     */
94 3
    public function getEmail()
95
    {
96 3
        return $this->getValueByKey($this->response, 'email');
97
    }
98
99
    /**
100
     * Returns the raw resource owner response.
101
     *
102
     * @return array
103
     */
104 3
    public function toArray()
105
    {
106 3
        return $this->response;
107
    }
108
}
109