GeneralDecorator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * @author @fabfuel <[email protected]>
4
 * @created 21.06.15, 08:59 
5
 */
6
namespace Fabfuel\Prophiler\Decorator;
7
8
use Fabfuel\Prophiler\ProfilerInterface;
9
10
class GeneralDecorator extends AbstractDecorator
11
{
12
    /**
13
     * @param object $decorated
14
     * @param ProfilerInterface $profiler
15
     */
16 2
    public function __construct($decorated, ProfilerInterface $profiler)
17
    {
18 2
        $this->setDecorated($decorated);
19 2
        $this->setProfiler($profiler);
20 2
    }
21
22
    /**
23
     * @return string
24
     */
25 1
    public function getComponentName()
26
    {
27 1
        return current(explode('\\', get_class($this->getDecorated()), 2));
28
    }
29
}
30