Completed
Push — master ( 374db5...638b83 )
by Alex
02:01
created

HeadHunterResourceOwner   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 55
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A getLastName() 0 4 1
A getFirstName() 0 4 1
A getMiddleName() 0 4 1
A toArray() 0 4 1
1
<?php
2
3
namespace AlexMasterov\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
6
7
class HeadHunterResourceOwner implements ResourceOwnerInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $response = [];
13
14
    /**
15
     * @param array $response
16
     */
17
    public function __construct(array $response)
18
    {
19
        $this->response = $response;
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getId()
26
    {
27
        return $this->response['id'];
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getLastName()
34
    {
35
        return $this->response['last_name'];
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getFirstName()
42
    {
43
        return $this->response['first_name'];
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getMiddleName()
50
    {
51
        return $this->response['middle_name'];
52
    }
53
54
    /**
55
     * @return array
56
     */
57
    public function toArray()
58
    {
59
        return $this->response;
60
    }
61
}
62