Collector::getTemplate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1.0029

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 6
cts 7
cp 0.8571
rs 9.4286
cc 1
eloc 7
nc 1
nop 0
crap 1.0029
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