PhpVersion::getBarContent()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4286
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Ndrx\Profiler\Renderer\Html\Data;
4
5
use Ndrx\Profiler\Renderer\Html\BarInterface;
6
use Ndrx\Profiler\Renderer\Html\Renderer;
7
8
/**
9
 * Created by PhpStorm.
10
 * User: arnaud
11
 * Date: 21/11/15
12
 * Time: 18:35
13
 */
14
class PhpVersion extends Renderer implements BarInterface
15
{
16
17
    /**
18
     * @return mixed
19
     */
20 2
    public function getTemplate()
21
    {
22 2
        return 'bar' . DIRECTORY_SEPARATOR . 'php-version.html.twig';
23
    }
24
25
    /**
26
     * @return string
27
     */
28 20
    public function getIcon()
29
    {
30 20
        return 'info';
31
    }
32
33
    /**
34
     * @return string
35
     */
36 20
    public function getTitle()
37
    {
38 20
        return 'Php version';
39
    }
40
41
    /**
42
     * @return string
43
     */
44 20
    public function getBadge()
45
    {
46 20
        return 'PHP';
47
    }
48
49
    /**
50
     * @return string
51
     */
52 20
    public function getBarContent()
53
    {
54 20
        if (array_key_exists('value', $this->profile)) {
55 18
            return $this->profile['value'];
56
        }
57
58 2
        return '-';
59
    }
60
}
61