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

RunkeeperResourceOwner   A

Complexity

Total Complexity 18

Size/Duplication

Total Lines 116
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 90.48%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 18
c 2
b 0
f 0
lcom 1
cbo 0
dl 0
loc 116
ccs 19
cts 21
cp 0.9048
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getEmail() 0 4 2
A getName() 0 4 2
A getLocation() 0 4 2
A getAthleteType() 0 4 2
A getGender() 0 4 2
A getBirthday() 0 4 2
A getElite() 0 4 2
A getProfile() 0 4 2
A toArray() 0 4 1
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