LogFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 9 1
A getColorClass() 0 8 1
1
<?php
2
/**
3
 * @author @fabfuel <[email protected]>
4
 * @created 17.11.14, 07:45 
5
 */
6
namespace Fabfuel\Prophiler\Toolbar\Formatter;
7
8
class LogFormatter extends BenchmarkFormatter
9
{
10
    /**
11
     * @return string
12
     */
13 3
    public function getLabel()
14
    {
15 3
        $severity = $this->getMetadata()['severity'];
16 3
        return sprintf(
17 3
            '<span class="label %s">%s</span>',
18 3
            $this->getColorClass(),
19 3
            strtoupper($severity)
20 3
        );
21
    }
22
23
    /**
24
     * @return string
25
     */
26 6
    public function getColorClass()
27
    {
28 6
        $severity = $this->getMetadata()['severity'];
29 6
        return sprintf(
30 6
            'severity-%s',
31
            $severity
32 6
        );
33
    }
34
}
35