HeadHunterResourceOwner::getMiddleName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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