MovesResourceOwner   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 66
ccs 11
cts 11
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 2
A getFirstDate() 0 4 2
A getCaloriesAvailable() 0 4 2
A toArray() 0 4 1
1
<?php
2
3
namespace League\OAuth2\Client\Provider;
4
5
class MovesResourceOwner implements ResourceOwnerInterface
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 id
33
     *
34
     * @return string|null
35
     */
36 3
    public function getId()
37
    {
38 3
        return $this->response['userId'] ?: null;
39
    }
40
41
    /**
42
     * Get resource owner email
43
     *
44
     * @return string|null
45
     */
46 3
    public function getFirstDate()
47
    {
48 3
        return $this->response['profile']['firstDate'] ?: null;
49
    }
50
51
    /**
52
     * Get resource owner first name
53
     *
54
     * @return string|null
55
     */
56 3
    public function getCaloriesAvailable()
57
    {
58 3
        return $this->response['profile']['caloriesAvailable'] ?: null;
59
    }
60
61
    /**
62
     * Return all of the owner details available as an array.
63
     *
64
     * @return array
65
     */
66 3
    public function toArray()
67
    {
68 3
        return $this->response;
69
    }
70
}
71