EventbriteResourceOwner   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 49
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 2
A getEmail() 0 4 2
A toArray() 0 4 1
1
<?php namespace Stevenmaguire\OAuth2\Client\Provider;
2
3
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
4
5
class EventbriteResourceOwner implements ResourceOwnerInterface
6
{
7
    /**
8
     * Raw response
9
     *
10
     * @var array
11
     */
12
    protected $response;
13
14
    /**
15
     * Creates new resource owner.
16
     *
17
     * @param array  $response
18
     */
19 3
    public function __construct(array $response = array())
20
    {
21 3
        $this->response = $response;
22 3
    }
23
24
    /**
25
     * Get user id
26
     *
27
     * @return string|null
28
     */
29 3
    public function getId()
30
    {
31 3
        return $this->response['user']['user_id'] ?: null;
32
    }
33
34
    /**
35
     * Get user email
36
     *
37
     * @return string|null
38
     */
39 3
    public function getEmail()
40
    {
41 3
        return $this->response['user']['email'] ?: null;
42
    }
43
44
    /**
45
     * Return all of the owner details available as an array.
46
     *
47
     * @return array
48
     */
49 3
    public function toArray()
50
    {
51 3
        return $this->response;
52
    }
53
}
54