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

BooleanFilterData::isApplicable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 0
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