Completed
Push — master ( f3441e...70aa26 )
by Daniel
08:43 queued 06:31
created

BooleanFilterData   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
A isApplicable() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid\Filter;
6
7
use Psi\Component\Grid\FilterDataInterface;
8
9
class BooleanFilterData implements FilterDataInterface
10
{
11
    const ANY_CHOICE = 'any';
12
13
    private $value;
14
15
    public function __construct($value = null)
16
    {
17
        $this->value = $value;
18
    }
19
20
    public function getValue()
21
    {
22
        return $this->value;
23
    }
24
25
    public function isApplicable(): bool
26
    {
27
        return $this->value !== null && $this->value !== self::ANY_CHOICE;
28
    }
29
}
30