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

FilterRule   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setEncodingFormat() 0 4 1
filter() 0 1 ?
A allowedNotSet() 0 4 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
     * @param string|null $encodingFormat
28
     */
29 147
    public function setEncodingFormat($encodingFormat)
30
    {
31 147
        $this->encodingFormat = $encodingFormat;
32 147
    }
33
34
    /**
35
     * @return bool
36
     */
37 10
    public function allowedNotSet()
38
    {
39 10
        return $this->allowNotSet;
40
    }
41
42
    /**
43
     * @param mixed $value
44
     * @return mixed
45
     */
46
    abstract public function filter($value);
47
}
48