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.

Label   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 9
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 50
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A info() 0 4 1
A success() 0 4 1
A warning() 0 4 1
A primary() 0 4 1
A danger() 0 4 1
A error() 0 4 1
A render() 0 6 1
A __invoke() 0 8 2
1
<?php
2
3
/**
4
 * Label view helper.
5
 *
6
 * @author     Leandro Silva <[email protected]>
7
 *
8
 * @category   LosUi
9
 *
10
 * @license    https://github.com/Lansoweb/LosUi/blob/master/LICENSE MIT License
11
 *
12
 * @link       http://github.com/LansoWeb/LosUi
13
 * @link       http://getbootstrap.com/components/#labels
14
 */
15
namespace LosUi\View\Helper;
16
17
/**
18
 * Label view helper.
19
 *
20
 * @author     Leandro Silva <[email protected]>
21
 *
22
 * @category   LosUi
23
 *
24
 * @license    https://github.com/Lansoweb/LosUi/blob/master/LICENSE MIT License
25
 *
26
 * @link       http://github.com/LansoWeb/LosUi
27
 * @link       http://getbootstrap.com/components/#labels
28
 */
29
class Label
30
{
31
    protected $format = '<span class="label %s">%s</span>';
32
33
    public function info($label)
34
    {
35
        return $this->render($label, 'label-info');
36
    }
37
38
    public function success($label)
39
    {
40
        return $this->render($label, 'label-success');
41
    }
42
43
    public function warning($label)
44
    {
45
        return $this->render($label, 'label-warning');
46
    }
47
48
    public function primary($label)
49
    {
50
        return $this->render($label, 'label-primary');
51
    }
52
53
    public function danger($label)
54
    {
55
        return $this->render($label, 'label-danger');
56
    }
57
58
    public function error($label)
59
    {
60
        return $this->danger($label);
61
    }
62
63
    public function render($label, $class = ' label-default')
64
    {
65
        $class = trim($class);
66
67
        return sprintf($this->format, $class, $label);
68
    }
69
70
    public function __invoke($label = null, $class = ' label-default')
71
    {
72
        if ($label) {
73
            return $this->render($label, $class);
74
        }
75
76
        return $this;
77
    }
78
}
79