FilterObject   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getValue() 0 3 1
A getField() 0 3 1
A isActive() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Blixit\EventSourcing\Store\Matcher;
6
7
/**
8
 * Class Filter. A value object that store a filter representation.
9
 *
10
 * @link     http://github.com/blixit
11
 */
12
class FilterObject
13
{
14
    /** @var string $field */
15
    private $field;
16
17
    /** @var mixed $value */
18
    private $value;
19
20
    /** @var bool $isActive */
21
    private $isActive;
22
23
    /**
24
     * @param mixed $value
25
     */
26
    public function __construct(string $field, $value, bool $isActive = true)
27
    {
28
        $this->field    = $field;
29
        $this->value    = $value;
30
        $this->isActive = $isActive;
31
    }
32
33
    public function getField() : string
34
    {
35
        return $this->field;
36
    }
37
38
    /**
39
     * @return mixed
40
     */
41
    public function getValue()
42
    {
43
        return $this->value;
44
    }
45
46
    public function isActive() : bool
47
    {
48
        return $this->isActive;
49
    }
50
}
51