Completed
Push — master ( 737a42...78c209 )
by Rick
03:30
created

FilterRule   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 1
Metric Value
wmc 4
c 6
b 0
f 1
lcom 0
cbo 0
dl 0
loc 55
ccs 10
cts 10
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setEncodingFormat() 0 4 1
A setFilterData() 0 4 1
A getFilterData() 0 4 1
A allowedNotSet() 0 4 1
filter() 0 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
abstract class FilterRule
15
{
16
    /**
17
     * @var string|null
18
     */
19
    protected $encodingFormat;
20
21
    /**
22
     * @var bool
23
     */
24
    protected $allowNotSet = false;
25
26
    /**
27
     * @var array|null
28
     */
29
    protected $filterData;
30
31
    /**
32
     * @param string|null $encodingFormat
33
     */
34 149
    public function setEncodingFormat($encodingFormat)
35
    {
36 149
        $this->encodingFormat = $encodingFormat;
37 149
    }
38
39
    /**
40
     * @param array|null $filterData
41
     */
42 149
    public function setFilterData($filterData)
43
    {
44 149
        $this->filterData = $filterData;
45 149
    }
46
47
    /**
48
     * @return array|null
49
     */
50 5
    public function getFilterData()
51
    {
52 5
        return $this->filterData;
53
    }
54
55
    /**
56
     * @return bool
57
     */
58 10
    public function allowedNotSet()
59
    {
60 10
        return $this->allowNotSet;
61
    }
62
63
    /**
64
     * @param mixed $value
65
     * @return mixed
66
     */
67
    abstract public function filter($value);
68
}
69