GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 95f832...b0c8ef )
by Gallice
03:50
created

UserProfile::getTimezone()   A

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 Tgallice\FBMessenger\Model;
4
5
class UserProfile
6
{
7
    const FIRST_NAME = 'first_name';
8
    const LAST_NAME = 'last_name';
9
    const PROFILE_PIC = 'profile_pic';
10
    const LOCALE = 'locale';
11
    const TIMEZONE = 'timezone';
12
    const GENDER = 'gender';
13
    const PAYMENT_ENABLED = 'is_payment_enabled';
14
15
    /**
16
     * @var array
17
     */
18
    private $data;
19
20
    /**
21
     * @param array $data
22
     */
23 9
    public function __construct(array $data)
24
    {
25 9
        $this->data = $data;
26 9
    }
27
28
    /**
29
     * @return null|string
30
     */
31 1
    public function getFirstName()
32
    {
33 1
        return $this->get(self::FIRST_NAME);
34
    }
35
36
    /**
37
     * @return null|string
38
     */
39 1
    public function getLastName()
40
    {
41 1
        return $this->get(self::LAST_NAME);
42
    }
43
44
    /**
45
     * @return null|string
46
     */
47 1
    public function getProfilePic()
48
    {
49 1
        return $this->get(self::PROFILE_PIC);
50
    }
51
52
    /**
53
     * @return null|string
54
     */
55 1
    public function getLocale()
56
    {
57 1
        return $this->get(self::LOCALE);
58
    }
59
60
    /**
61
     * @return null|string
62
     */
63 1
    public function getTimezone()
64
    {
65 1
        return $this->get(self::TIMEZONE);
66
    }
67
68
    /**
69
     * @return null|string
70
     */
71 1
    public function getGender()
72
    {
73 1
        return $this->get(self::GENDER);
74
    }
75
76
    /**
77
     * @return bool
78
     */
79 1
    public function isPaymentEnabled()
80
    {
81 1
        return (bool) $this->get(self::PAYMENT_ENABLED);
82
    }
83
84 7
    private function get($index)
85
    {
86 7
        return isset($this->data[$index]) ? $this->data[$index] : null;
87
    }
88
89
    /**
90
     * @param array $data
91
     *
92
     * @return UserProfile
93
     */
94 1
    public static function create(array $data)
95
    {
96 1
        return new self($data);
97
    }
98
}
99