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.

SeenUpdate   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 86
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 86
ccs 7
cts 23
cp 0.3043
rs 10
wmc 7

7 Methods

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