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.

Language::getDirection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
3
namespace NStack\Models;
4
5
/**
6
 * Class Continent
7
 *
8
 * @package NStack\Models
9
 * @author  Casper Rasmussen <[email protected]>
10
 */
11
class Language extends Model
12
{
13
    /** @var int */
14
    protected $id;
15
16
    /** @var string */
17
    protected $name;
18
19
    /** @var string */
20
    protected $locale;
21
22
    /** @var string */
23
    protected $direction;
24
25
    /** @var bool */
26
    protected $isDefault;
27
28
    /** @var bool */
29
    protected $isBestFit;
30
31
    /**
32
     * parse
33
     *
34
     * @param array $data
35
     * @author Casper Rasmussen <[email protected]>
36
     */
37 5
    public function parse(array $data)
38
    {
39 5
        $this->id = (int)$data['id'];
40 5
        $this->name = (string)$data['name'];
41 5
        $this->locale = (string)$data['locale'];
42 5
        $this->direction = (string)$data['direction'];
43 5
        $this->isDefault = (bool)$data['is_default'];
44 5
        $this->isBestFit = (bool)$data['is_best_fit'];
45 5
    }
46
47
    /**
48
     * toArray
49
     *
50
     * @return array
51
     * @author Casper Rasmussen <[email protected]>
52
     */
53
    public function toArray(): array
54
    {
55
        return [
56
            'id'          => $this->id,
57
            'name'        => $this->name,
58
            'locale'      => $this->locale,
59
            'direction'   => $this->direction,
60
            'is_default'  => $this->isDefault,
61
            'is_best_fit' => $this->isBestFit,
62
        ];
63
    }
64
65
    /**
66
     * @return int
67
     * @author Casper Rasmussen <[email protected]>
68
     */
69
    public function getId(): int
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * @return string
76
     * @author Casper Rasmussen <[email protected]>
77
     */
78
    public function getName(): string
79
    {
80
        return $this->name;
81
    }
82
83
    /**
84
     * @return string
85
     * @author Casper Rasmussen <[email protected]>
86
     */
87
    public function getLocale(): string
88
    {
89
        return $this->locale;
90
    }
91
92
    /**
93
     * @return string
94
     * @author Casper Rasmussen <[email protected]>
95
     */
96
    public function getDirection(): string
97
    {
98
        return $this->direction;
99
    }
100
101
    /**
102
     * @return bool
103
     * @author Casper Rasmussen <[email protected]>
104
     */
105
    public function isDefault(): bool
106
    {
107
        return $this->isDefault;
108
    }
109
110
    /**
111
     * @return bool
112
     * @author Casper Rasmussen <[email protected]>
113
     */
114
    public function isBestFit(): bool
115
    {
116
        return $this->isBestFit;
117
    }
118
}