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.

BuildStatus::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Jamal\JenkinsArduino\Jenkins;
4
5
/**
6
 * @author Caio Almeida <[email protected]>
7
 * @codeCoverageIgnore
8
 */
9
class BuildStatus
10
{
11
    const BUILDING  = 'BUILDING';
12
    const SUCCESS   = 'SUCCESS';
13
    const FAILURE   = 'FAILURE';
14
    const UNSTABLE  = 'UNSTABLE';
15
    const ABORTED   = 'ABORTED';
16
17
    /**
18
     * @var string
19
     */
20
    protected $status;
21
22
    /**
23
     * @param string $status
24
     */
25
    public function __construct($status)
26
    {
27
        $this->status = $status;
28
29
        if ($this->status == null) {
30
            $this->status = self::BUILDING;
31
        }
32
    }
33
34
    /**
35
     * @return int
36
     */
37
    public function getCode()
38
    {
39
        $codes = [
40
            self::BUILDING  => 0,
41
            self::FAILURE   => 1,
42
            self::SUCCESS   => 2,
43
            self::UNSTABLE  => 3,
44
            self::ABORTED   => 4
45
        ];
46
47
        return $codes[$this->status];
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function __toString()
54
    {
55
        return $this->status;
56
    }
57
}
58