PluginAbstract::getProfiler()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @fabfuel <[email protected]>
4
 * @created 16.11.14, 20:05 
5
 */
6
namespace Fabfuel\Prophiler\Plugin;
7
8
use Fabfuel\Prophiler\ProfilerInterface;
9
10
abstract class PluginAbstract
11
{
12
    /**
13
     * @var ProfilerInterface
14
     */
15
    protected $profiler;
16
17
    /**
18
     * @param ProfilerInterface $profiler
19
     * @return static
20
     */
21 11
    public static function getInstance(ProfilerInterface $profiler)
22
    {
23 11
        $plugin = new static;
24 11
        $plugin->setProfiler($profiler);
25 11
        return $plugin;
26
    }
27
28
    /**
29
     * @return ProfilerInterface
30
     */
31 1
    public function getProfiler()
32
    {
33 1
        return $this->profiler;
34
    }
35
36
    /**
37
     * @param ProfilerInterface $profiler
38
     */
39 11
    public function setProfiler(ProfilerInterface $profiler)
40
    {
41 11
        $this->profiler = $profiler;
42 11
    }
43
}
44