GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TableFilter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 106
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 106
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 102 2
1
<?php
2
3
namespace ZfTable\Form;
4
5
use Zend\InputFilter\InputFilter;
6
7
class TableFilter extends InputFilter
8
{
9
10
    public function __construct($columnFields = null)
11
    {
12
        //Create an input to filter the items of a generic table
13
        $this->add(array(
14
            'name'     => 'zfTableItemPerPage',
15
            'allowEmpty' => true,
16
            'required' => false,
17
            'filters'  => array(
18
                array('name' => 'StripTags'),
19
                array('name' => 'StringTrim'),
20
            ),
21
            'validators' => array(
22
                array(
23
                    'name'    => 'StringLength',
24
                    'options' => array(
25
                        'encoding' => 'UTF-8',
26
                        'min'      => 0,
27
                        'max'      => 30,
28
                    ),
29
                ),
30
            ),
31
        ));
32
        $this->add(array(
33
            'name'     => 'zfTableQuickSearch',
34
            'allowEmpty' => true,
35
            'required' => false,
36
            'filters'  => array(
37
                array('name' => 'StripTags'),
38
                array('name' => 'StringTrim'),
39
            ),
40
            'validators' => array(
41
                array(
42
                    'name'    => 'StringLength',
43
                    'options' => array(
44
                        'encoding' => 'UTF-8',
45
                        'min'      => 0,
46
                        'max'      => 40,
47
                    ),
48
                ),
49
            ),
50
        ));
51
        $this->add(array(
52
            'name'     => 'zfTableOrder',
53
            'allowEmpty' => true,
54
            'required' => false,
55
            'filters'  => array(
56
                array('name' => 'StripTags'),
57
                array('name' => 'StringTrim'),
58
            ),
59
            'validators' => array(
60
                array(
61
                    'name'    => 'StringLength',
62
                    'options' => array(
63
                        'encoding' => 'UTF-8',
64
                        'min'      => 0,
65
                        'max'      => 10,
66
                    ),
67
                ),
68
            ),
69
        ));
70
        $this->add(array(
71
            'name'     => 'zfTableColumn',
72
            'allowEmpty' => true,
73
            'required' => false,
74
            'filters'  => array(
75
                array('name' => 'StripTags'),
76
                array('name' => 'StringTrim'),
77
            ),
78
            'validators' => array(
79
                array(
80
                    'name'    => 'StringLength',
81
                    'options' => array(
82
                        'encoding' => 'UTF-8',
83
                        'min'      => 0,
84
                        'max'      => 30,
85
                    ),
86
                ),
87
            ),
88
        ));
89
        //Creates a filter for each of the input fields
90
        foreach ($columnFields as $fieldName) {
91
            $this->add(array(
92
                'name'     => 'zff_' . $fieldName,
93
                'allowEmpty' => true,
94
                'required' => false,
95
                'filters'  => array(
96
                    array('name' => 'StripTags'),
97
                    array('name' => 'StringTrim'),
98
                ),
99
                'validators' => array(
100
                    array(
101
                        'name'    => 'StringLength',
102
                        'options' => array(
103
                            'encoding' => 'UTF-8',
104
                            'min'      => 0,
105
                            'max'      => 30,
106
                        ),
107
                    ),
108
                ),
109
            ));
110
        }
111
    }
112
}
113