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.

Badge   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 4 1
A __invoke() 0 8 2
1
<?php
2
3
/**
4
 * Badge view helper styled for Bootstrap 3.
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/#badges
14
 */
15
namespace LosUi\View\Helper;
16
17
/**
18
 * Badge view helper styled for Bootstrap 3.
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/#badges
28
 */
29
class Badge
30
{
31
    protected $format = '<span class="badge">%s</span>';
32
33
    public function render($badge)
34
    {
35
        return sprintf($this->format, $badge);
36
    }
37
38
    public function __invoke($badge = null)
39
    {
40
        if ($badge) {
41
            return $this->render($badge);
42
        }
43
44
        return $this;
45
    }
46
}
47