Completed
Push — master ( b133bf...737a42 )
by Rick
04:48
created

FilterResult::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * Particle.
4
 *
5
 * @link      http://github.com/particle-php for the canonical source repository
6
 * @copyright Copyright (c) 2005-2015 Particle (http://particle-php.com)
7
 * @license   https://github.com/particle-php/Filter/blob/master/LICENSE New BSD License
8
 */
9
namespace Particle\Filter;
10
11
/**
12
 * @package Particle\Filter
13
 */
14
class FilterResult
15
{
16
    /**
17
     * @var bool
18
     */
19
    protected $isSet;
20
21
    /**
22
     * @var mixed
23
     */
24
    protected $filteredValue;
25
26
    /**
27
     * @param bool $isSet
28
     * @param null|mixed $filteredValue
29
     */
30 147
    public function __construct($isSet, $filteredValue = null)
31
    {
32 147
        $this->isSet = $isSet;
33 147
        $this->filteredValue = $filteredValue;
34 147
    }
35
36
    /**
37
     * Is the filter result not empty
38
     *
39
     * @return bool
40
     */
41 145
    public function isNotEmpty()
42
    {
43 145
        return $this->isSet;
44
    }
45
46
    /**
47
     * Get the filtered value
48
     *
49
     * @return mixed|null
50
     */
51 146
    public function getFilteredValue()
52
    {
53 146
        return $this->filteredValue;
54
    }
55
}
56