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.

Timezone   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Test Coverage

Coverage 30.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
c 1
b 0
f 0
dl 0
loc 96
rs 10
ccs 7
cts 23
cp 0.3043
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getOffsetSec() 0 3 1
A getId() 0 3 1
A parse() 0 7 1
A getLabel() 0 3 1
A getName() 0 3 1
A toArray() 0 8 1
A getAbbr() 0 3 1
1
<?php
2
3
namespace NStack\Models;
4
5
/**
6
 * Class Timezone
7
 *
8
 * @package NStack\Models
9
 * @author  Casper Rasmussen <[email protected]>
10
 */
11
class Timezone extends Model
12
{
13
    /** @var int */
14
    protected $id;
15
16
    /** @var string */
17
    protected $name;
18
19
    /** @var string */
20
    protected $abbr;
21
22
    /** @var int */
23
    protected $offsetSec;
24
25
    /** @var string */
26
    protected $label;
27
28
    /**
29
     * parse
30
     *
31
     * @param array $data
32
     * @author Casper Rasmussen <[email protected]>
33
     */
34 5
    public function parse(array $data)
35
    {
36 5
        $this->id = (int)$data['id'];
37 5
        $this->name = (string)$data['name'];
38 5
        $this->abbr = (string)$data['abbr'];
39 5
        $this->offsetSec = (int)$data['offset_sec'];
40 5
        $this->label = (string)$data['label'];
41 5
    }
42
43
    /**
44
     * toArray
45
     *
46
     * @return array
47
     * @author Casper Rasmussen <[email protected]>
48
     */
49
    public function toArray(): array
50
    {
51
        return [
52
            'id'         => $this->id,
53
            'name'       => $this->name,
54
            'abbr'       => $this->abbr,
55
            'offset_sec' => $this->offsetSec,
56
            'label'      => $this->label,
57
        ];
58
    }
59
60
    /**
61
     * @return int
62
     * @author Casper Rasmussen <[email protected]>
63
     */
64
    public function getId(): int
65
    {
66
        return $this->id;
67
    }
68
69
    /**
70
     * @return string
71
     * @author Casper Rasmussen <[email protected]>
72
     */
73
    public function getName(): string
74
    {
75
        return $this->name;
76
    }
77
78
    /**
79
     * @return string
80
     * @author Casper Rasmussen <[email protected]>
81
     */
82
    public function getAbbr(): string
83
    {
84
        return $this->abbr;
85
    }
86
87
    /**
88
     * getOffsetSec
89
     *
90
     * @return int
91
     * @author Casper Rasmussen <[email protected]>
92
     */
93
    public function getOffsetSec(): int
94
    {
95
        return $this->offsetSec;
96
    }
97
98
    /**
99
     * getLabel
100
     *
101
     * @return string
102
     * @author Casper Rasmussen <[email protected]>
103
     */
104
    public function getLabel(): string
105
    {
106
        return $this->label;
107
    }
108
}