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.
Passed
Push — master ( 556562...8743ff )
by Casper
07:04 queued 05:11
created

CollectionItem   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 46
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
A parse() 0 4 1
A getId() 0 3 1
A getKey() 0 3 1
1
<?php
2
3
namespace NStack\Tests\objects;
4
5
use NStack\Models\Model;
6
7
/**
8
 * Class CollectionItem
9
 *
10
 * @package NStack\Tests\objects
11
 * @author  Tiago Araujo <[email protected]>
12
 */
13
class CollectionItem extends Model
14
{
15
    /** @var int */
16
    protected $id;
17
18
    /** @var string */
19
    protected $key;
20
21
    /**
22
     * parse
23
     *
24
     * @param array $data
25
     */
26
    public function parse(array $data)
27
    {
28
        $this->id = (int)$data['id'];
29
        $this->key = (string)$data['key'];
30
    }
31
32
    /**
33
     * toArray
34
     *
35
     * @return array
36
     */
37
    public function toArray(): array
38
    {
39
        return [
40
            'id' => $this->id,
41
            'key' => $this->key,
42
        ];
43
    }
44
45
    /**
46
     * @return int
47
     */
48
    public function getId(): int
49
    {
50
        return $this->id;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getKey(): string
57
    {
58
        return $this->key;
59
    }
60
61
}