Completed
Push — master ( 8d90d0...fcb8a3 )
by Edwin
02:47
created

RunkeeperResourceOwner::getId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace League\OAuth2\Client\Provider;
4
5
class RunkeeperResourceOwner implements ResourceOwnerInterface
0 ignored issues
show
Bug introduced by
There is one abstract method getId in this class; you could implement it, or declare this class as abstract.
Loading history...
6
{
7
    /**
8
     * Domain
9
     *
10
     * @var string
11
     */
12
    protected $domain;
13
14
    /**
15
     * Raw response
16
     *
17
     * @var array
18
     */
19
    protected $response;
20
21
    /**
22
     * Creates new resource owner.
23
     *
24
     * @param array $response
25
     */
26 3
    public function __construct(array $response = [])
27
    {
28 3
        $this->response = $response;
29 3
    }
30
31
    /**
32
     * Get resource owner email
33
     *
34
     * @return string|null
35
     */
36
    public function getEmail()
37
    {
38
        return $this->response['email'] ?: null;
39
    }
40
41
    /**
42
     * Get resource owner name
43
     *
44
     * @return string|null
45
     */
46 3
    public function getName()
47
    {
48 3
        return $this->response['name'] ?: null;
49
    }
50
51
    /**
52
     * Get resource owner location
53
     *
54
     * @return string|null
55
     */
56 3
    public function getLocation()
57
    {
58 3
        return $this->response['location'] ?: null;
59
    }
60
61
    /**
62
     * Get resource owner athlete type
63
     *
64
     * @return string|null
65
     */
66 3
    public function getAthleteType()
67
    {
68 3
        return $this->response['athlete_type'] ?: null;
69
    }
70
71
    /**
72
     * Get resource owner gender
73
     *
74
     * @return string|null
75
     */
76 3
    public function getGender()
77
    {
78 3
        return $this->response['gender'] ?: null;
79
    }
80
81
    /**
82
     * Get resource owner birthdat
83
     *
84
     * @return string|null
85
     */
86 3
    public function getBirthday()
87
    {
88 3
        return $this->response['birthday'] ?: null;
89
    }
90
91
    /**
92
     * Get resource owner elite status (subscriber)
93
     *
94
     * @return boolean|false
95
     */
96 3
    public function getElite()
97
    {
98 3
        return $this->response['elite'] ?: false;
99
    }
100
101
    /**
102
     * Get resource owner public profile url
103
     *
104
     * @return boolean|false
105
     */
106 3
    public function getProfile()
107
    {
108 3
        return $this->response['profile'] ?: false;
109
    }
110
111
    /**
112
     * Return all of the owner details available as an array.
113
     *
114
     * @return array
115
     */
116 3
    public function toArray()
117
    {
118 3
        return $this->response;
119
    }
120
}
121