GuardianResourceOwner   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 81
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getExpires() 0 4 1
A getEmail() 0 4 1
A getId() 0 4 1
A getDomain() 0 4 1
A getScopes() 0 4 1
A toArray() 0 4 1
1
<?php namespace Flipbox\OAuth2\Client\Provider;
2
3
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
4
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
5
6
class GuardianResourceOwner implements ResourceOwnerInterface
7
{
8
    use ArrayAccessorTrait;
9
10
    /**
11
     * Raw response
12
     *
13
     * @var array
14
     */
15
    protected $response;
16
17
    /**
18
     * Creates new resource owner.
19
     *
20
     * @param array  $response
21
     */
22 15
    public function __construct(array $response = array())
23
    {
24 15
        $this->response = $response;
25 15
    }
26
27
    /**
28
     * Get resource expires
29
     *
30
     * @return int|null
31
     */
32 3
    public function getExpires()
33
    {
34 3
        return $this->getValueByKey($this->response, 'expires');
35
    }
36
37
    /**
38
     * Get resource owner email
39
     *
40
     * @return string|null
41
     */
42 9
    public function getEmail()
43
    {
44 9
        return $this->getValueByKey($this->response, 'email');
45
    }
46
47
    /**
48
     * Get resource owner id
49
     *
50
     * @return int|null
51
     */
52 9
    public function getId()
53
    {
54 9
        return $this->getValueByKey($this->response, 'id');
55
    }
56
57
    /**
58
     * Get resource owner domain
59
     *
60
     * @return int|null
61
     */
62 9
    public function getDomain()
63
    {
64 9
        return $this->getValueByKey($this->response, 'domain');
65
    }
66
67
    /**
68
     * Get resource owner scopes
69
     *
70
     * @return array|null
71
     */
72 3
    public function getScopes()
73
    {
74 3
        return $this->getValueByKey($this->response, 'scopes');
75
    }
76
77
    /**
78
     * Return all of the owner details available as an array.
79
     *
80
     * @return array
81
     */
82 3
    public function toArray()
83
    {
84 3
        return $this->response;
85
    }
86
}
87