Completed
Push — master ( 2d3e3c...0995af )
by Rob
09:50 queued 08:39
created

AbstractHandler   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 11
lcom 1
cbo 0
dl 0
loc 70
ccs 18
cts 27
cp 0.6667
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
A setValue() 0 5 1
A getName() 0 4 1
A setName() 0 5 1
A getWrappers() 0 4 1
A isActive() 0 4 1
A getScore() 0 4 1
A setScore() 0 5 1
A pushWrapper() 0 5 1
A getPrefixes() 0 4 1
1
<?php
2
3
namespace devtoolboxuk\cerberus\Handlers;
4
5
abstract class AbstractHandler
6
{
7
    private $active = false;
8
    private $wrappers = [];
9
    private $value;
10
    private $name;
11
    private $prefixes;
12
13
    private $score;
14
15 4
    public function __construct($value)
16
    {
17 4
        $this->setValue($value);
18 4
    }
19
20 4
    public function getValue()
21
    {
22 4
        return $this->value;
23
    }
24
25 4
    protected function setValue($value)
26
    {
27 4
        $this->value = $value;
28 4
        return $this;
29
    }
30
31 4
    public function getName()
32
    {
33 4
        return $this->name;
34
    }
35
36 4
    protected function setName($value)
37
    {
38 4
        $this->name = $value;
39 4
        return $this;
40
    }
41
42 4
    public function getWrappers()
43
    {
44 4
        return $this->wrappers;
45
    }
46
47
    public function isActive()
48
    {
49
        return $this->active;
50
    }
51
52
    public function getScore()
53
    {
54
        return $this->score;
55
    }
56
57
    public function setScore($score)
58
    {
59
        $this->score = $score;
60
        return $this;
61
    }
62
63 4
    public function pushWrapper($wrapper)
64
    {
65 4
        array_unshift($this->wrappers, $wrapper);
66 4
        return $this;
67
    }
68
69
    protected function getPrefixes()
70
    {
71
        return $this->prefixes;
72
    }
73
74
}