Completed
Pull Request — master (#48)
by
unknown
06:27 queued 10s
created

FilterResult::isNotEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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