KobasResourceOwner::getLastname()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Kobas\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
6
7
class KobasResourceOwner implements ResourceOwnerInterface
8
{
9
    /**
10
     * Raw response
11
     *
12
     * @var array
13
     */
14
    protected $response;
15
    /**
16
     * Creates new resource owner.
17
     *
18
     * @param array  $response
19
     */
20 3
    public function __construct(array $response = array())
21
    {
22 3
        $this->response = $response;
23 3
    }
24
    /**
25
     * Get user email
26
     *
27
     * @return string|null
28
     */
29 3
    public function getEmail()
30
    {
31 3
        return $this->response['email'] ?: null;
32
    }
33
    /**
34
     * Get user firstname
35
     *
36
     * @return string|null
37
     */
38 3
    public function getFirstname()
39
    {
40 3
        return $this->response['first_name'] ?: null;
41
    }
42
    /**
43
     * Get user imageurl
44
     *
45
     * @return string|null
46
     */
47 3
    public function getImageurl()
48
    {
49 3
        return $this->response['picture'] ?: null;
50
    }
51
    /**
52
     * Get user lastname
53
     *
54
     * @return string|null
55
     */
56 3
    public function getLastname()
57
    {
58 3
        return $this->response['last_name'] ?: null;
59
    }
60
    /**
61
     * Get user userId
62
     *
63
     * @return string|null
64
     */
65 3
    public function getId()
66
    {
67 3
        return $this->response['uuid'] ?: null;
68
    }
69
    /**
70
     * Return all of the owner details available as an array.
71
     *
72
     * @return array
73
     */
74 3
    public function toArray()
75
    {
76 3
        return $this->response;
77
    }
78
}
79