PluginAbstract   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 34
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 6 1
A getProfiler() 0 4 1
A setProfiler() 0 4 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