Collector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 88.89%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
ccs 8
cts 9
cp 0.8889
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTemplate() 0 10 1
A getIcon() 0 4 1
1
<?php
2
3
namespace Ndrx\Profiler\Renderer\Html\Data;
4
5
use Ndrx\Profiler\Renderer\Html\Renderer;
6
7
/**
8
 * Created by PhpStorm.
9
 * User: arnaud
10
 * Date: 21/11/15
11
 * Time: 18:35
12
 */
13
abstract class Collector extends Renderer
14
{
15
16
    /**
17
     * @return mixed
18
     */
19 60
    public function getTemplate()
20
    {
21 60
        $reflectionClassName = new \ReflectionClass(get_class($this));
22 60
        $pattern = '/([a-z])([A-Z])/';
23 60
        $name = strtolower(preg_replace_callback($pattern, function ($a) {
24
            return $a[1] . '-' . strtolower($a[2]);
25 60
        }, $reflectionClassName->getShortName()));
26
27 60
        return 'tab' . DIRECTORY_SEPARATOR . $name . '.html.twig';
28
    }
29
30
    /**
31
     * @return string
32
     */
33 8
    public function getIcon()
34
    {
35 8
        return 'info';
36
    }
37
}
38