Completed
Push — master ( 91478b...864223 )
by Oleg
02:11
created

EveOnlineResourceOwner   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 8
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 60
ccs 11
cts 11
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCharacterID() 0 4 2
A getCharacterName() 0 4 2
A getCharacterOwnerHash() 0 4 2
A toArray() 0 4 1
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