EveOnlineResourceOwner::getCharacterOwnerHash()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Evelabs\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\GenericResourceOwner;
6
7
class EveOnlineResourceOwner extends GenericResourceOwner
8
{
9
    /**
10
     * Raw response
11
     *
12
     * @var array
13
     */
14
    protected $response;
15
16
17
    /**
18
     * Creates new resource owner.
19
     *
20
     * @param array  $response
21
     */
22 3
    public function __construct(array $response = array())
23
    {
24 3
        $this->response = $response;
25 3
    }
26
27
    /**
28
     * Get user characterID
29
     *
30
     * @return string|null
31
     */
32 3
    public function getCharacterID()
33
    {
34 3
        return $this->response['CharacterID'] ?: null;
35
    }
36
37
    /**
38
     * Get user characterName
39
     *
40
     * @return string|null
41
     */
42 3
    public function getCharacterName()
43
    {
44 3
        return $this->response['CharacterName'] ?: null;
45
    }
46
47
    /**
48
     * Get user CharacterOwnerHash
49
     *
50
     * @return string|null
51
     */
52 3
    public function getCharacterOwnerHash()
53
    {
54 3
        return $this->response['CharacterOwnerHash'] ?: null;
55
    }
56
57
    /**
58
     * Return all of the owner details available as an array.
59
     *
60
     * @return array
61
     */
62 3
    public function toArray()
63
    {
64 3
        return $this->response;
65
    }
66
}
67