HeadHunterResourceOwner   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 57
ccs 13
cts 13
cp 1
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
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
7
8
class HeadHunterResourceOwner implements ResourceOwnerInterface
9
{
10
    use ArrayAccessorTrait;
11
12
    /**
13
     * @var array
14
     */
15
    protected $response = [];
16
17
    /**
18
     * @param array $response
19
     */
20 1
    public function __construct(array $response = [])
21
    {
22 1
        $this->response = $response;
23 1
    }
24
25
    /**
26
     * @return string
27
     */
28 1
    public function getId()
29
    {
30 1
        return $this->getValueByKey($this->response, 'id');
31
    }
32
33
    /**
34
     * @return string
35
     */
36 1
    public function getLastName()
37
    {
38 1
        return $this->getValueByKey($this->response, 'last_name');
39
    }
40
41
    /**
42
     * @return string
43
     */
44 1
    public function getFirstName()
45
    {
46 1
        return $this->getValueByKey($this->response, 'first_name');
47
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function getMiddleName()
53
    {
54 1
        return $this->getValueByKey($this->response, 'middle_name');
55
    }
56
57
    /**
58
     * @return array
59
     */
60 1
    public function toArray()
61
    {
62 1
        return $this->response;
63
    }
64
}
65