UntappdUser::getLastName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Shadowhand\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
6
7
class UntappdUser implements ResourceOwnerInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $response;
13
14
    /**
15
     * @param array $response
16
     */
17 1
    public function __construct(array $response)
18
    {
19 1
        $this->response = $response;
20 1
    }
21
22 1
    public function getId()
23
    {
24 1
        return $this->response['uid'];
25
    }
26
27
    /**
28
     * Get the username.
29
     *
30
     * @return string
31
     */
32 1
    public function getUsername()
33
    {
34 1
        return $this->response['user_name'];
35
    }
36
37
    /**
38
     * Get perferred first name.
39
     *
40
     * @return string
41
     */
42 1
    public function getFirstName()
43
    {
44 1
        return $this->response['first_name'];
45
    }
46
47
    /**
48
     * Get perferred last name.
49
     *
50
     * @return string
51
     */
52 1
    public function getLastName()
53
    {
54 1
        return $this->response['last_name'];
55
    }
56
57
    /**
58
     * Get email address.
59
     *
60
     * @return string
61
     */
62 1
    public function getEmail()
63
    {
64 1
        return $this->response['settings']['email_address'];
65
    }
66
67
    /**
68
     * Get user data as an array.
69
     *
70
     * @return array
71
     */
72 1
    public function toArray()
73
    {
74 1
        return $this->response;
75
    }
76
}
77