Completed
Push — develop ( b86568...ee5263 )
by FX
04:55
created

Status   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 3 1
1
<?php
2
3
/**
4
 * Copyright (c) 2017 Francois-Xavier Soubirou.
5
 *
6
 * This file is part of ci-report.
7
 *
8
 * ci-report is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * ci-report is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with ci-report. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
declare(strict_types=1);
22
23
namespace App\Entity;
24
25
/**
26
 * Status class.
27
 *
28
 * @category  ci-report app
29
 *
30
 * @author    Francois-Xavier Soubirou <[email protected]>
31
 * @copyright 2017 Francois-Xavier Soubirou
32
 * @license   http://www.gnu.org/licenses/   GPLv3
33
 *
34
 * @see      https://www.ci-report.io
35
 */
36
class Status
37
{
38
    const UNKNOWN = 1;
39
    const SUCCESS = 2;
40
    const WARNING = 4;
41
    const FAILED = 8;
42
43
    const LABEL = array(
44
        1 => 'Unknown',
45
        2 => 'Success',
46
        4 => 'Warning',
47
        8 => 'Failure',
48
    );
49
50
    /**
51
     * Get label status.
52
     *
53
     * @param int $status Status id
54
     *
55
     * @return string
56
     */
57
    public static function getLabel(int $status): string
58
    {
59
        return self::LABEL[$status];
60
    }
61
}
62