UserResponse::getLastName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

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
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Response;
6
7
use Kerox\Messenger\UserInterface;
8
9
class UserResponse extends AbstractResponse implements UserInterface
10
{
11
    /**
12
     * @var string|null
13
     */
14
    protected $firstName;
15
16
    /**
17
     * @var string|null
18
     */
19
    protected $lastName;
20
21
    /**
22
     * @var string|null
23
     */
24
    protected $profilePic;
25
26
    /**
27
     * @var string|null
28
     */
29
    protected $locale;
30
31
    /**
32
     * @var float|null
33
     */
34
    protected $timezone;
35
36
    /**
37
     * @var string|null
38
     */
39
    protected $gender;
40
41 1
    protected function parseResponse(array $response): void
42
    {
43 1
        $this->firstName = $response[UserInterface::FIRST_NAME] ?? null;
44 1
        $this->lastName = $response[UserInterface::LAST_NAME] ?? null;
45 1
        $this->profilePic = $response[UserInterface::PROFILE_PIC] ?? null;
46 1
        $this->locale = $response[UserInterface::LOCALE] ?? null;
47 1
        $this->timezone = $response[UserInterface::TIMEZONE] ?? null;
48 1
        $this->gender = $response[UserInterface::GENDER] ?? null;
49 1
    }
50
51 1
    public function getFirstName(): ?string
52
    {
53 1
        return $this->firstName;
54
    }
55
56 1
    public function getLastName(): ?string
57
    {
58 1
        return $this->lastName;
59
    }
60
61 1
    public function getProfilePic(): ?string
62
    {
63 1
        return $this->profilePic;
64
    }
65
66 1
    public function getLocale(): ?string
67
    {
68 1
        return $this->locale;
69
    }
70
71 1
    public function getTimezone(): ?float
72
    {
73 1
        return $this->timezone;
74
    }
75
76 1
    public function getGender(): ?string
77
    {
78 1
        return $this->gender;
79
    }
80
}
81