Passed
Push — master ( f4c77f...3f5b4e )
by Romain
36s
created

UserResponse::isPaymentEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
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 null|string
13
     */
14
    protected $firstName;
15
16
    /**
17
     * @var null|string
18
     */
19
    protected $lastName;
20
21
    /**
22
     * @var null|string
23
     */
24
    protected $profilePic;
25
26
    /**
27
     * @var null|string
28
     */
29
    protected $locale;
30
31
    /**
32
     * @var null|float
33
     */
34
    protected $timezone;
35
36
    /**
37
     * @var null|string
38
     */
39
    protected $gender;
40
41
    /**
42
     * @param array $response
43
     */
44 1
    protected function parseResponse(array $response): void
45
    {
46 1
        $this->firstName = $response[UserInterface::FIRST_NAME] ?? null;
47 1
        $this->lastName = $response[UserInterface::LAST_NAME] ?? null;
48 1
        $this->profilePic = $response[UserInterface::PROFILE_PIC] ?? null;
49 1
        $this->locale = $response[UserInterface::LOCALE] ?? null;
50 1
        $this->timezone = $response[UserInterface::TIMEZONE] ?? null;
51 1
        $this->gender = $response[UserInterface::GENDER] ?? null;
52 1
    }
53
54
    /**
55
     * @return null|string
56
     */
57 1
    public function getFirstName(): ?string
58
    {
59 1
        return $this->firstName;
60
    }
61
62
    /**
63
     * @return null|string
64
     */
65 1
    public function getLastName(): ?string
66
    {
67 1
        return $this->lastName;
68
    }
69
70
    /**
71
     * @return null|string
72
     */
73 1
    public function getProfilePic(): ?string
74
    {
75 1
        return $this->profilePic;
76
    }
77
78
    /**
79
     * @return null|string
80
     */
81 1
    public function getLocale(): ?string
82
    {
83 1
        return $this->locale;
84
    }
85
86
    /**
87
     * @return null|float
88
     */
89 1
    public function getTimezone(): ?float
90
    {
91 1
        return $this->timezone;
92
    }
93
94
    /**
95
     * @return null|string
96
     */
97 1
    public function getGender(): ?string
98
    {
99 1
        return $this->gender;
100
    }
101
}
102