PhpVersion   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 6
c 4
b 0
f 0
lcom 1
cbo 1
dl 0
loc 47
ccs 12
cts 12
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplate() 0 4 1
A getIcon() 0 4 1
A getTitle() 0 4 1
A getBadge() 0 4 1
A getBarContent() 0 8 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