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

FilterResult   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 42
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isNotEmpty() 0 4 1
A getFilteredValue() 0 4 1
A __construct() 0 5 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