FilterResult::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
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-2016 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 $isNotEmpty;
20
21
    /**
22
     * @var mixed
23
     */
24
    protected $filteredValue;
25
26
    /**
27
     * @param bool $isNotEmpty
28
     * @param null|mixed $filteredValue
29
     */
30 191
    public function __construct($isNotEmpty, $filteredValue = null)
31
    {
32 191
        $this->isNotEmpty = $isNotEmpty;
33 191
        $this->filteredValue = $filteredValue;
34 191
    }
35
36
    /**
37
     * Is the filter result not empty
38
     *
39
     * @return bool
40
     */
41 191
    public function isNotEmpty()
42
    {
43 191
        return $this->isNotEmpty;
44
    }
45
46
    /**
47
     * Get the filtered value
48
     *
49
     * @return mixed|null
50
     */
51 183
    public function getFilteredValue()
52
    {
53 183
        return $this->filteredValue;
54
    }
55
}
56