Completed
Push — master ( d913d0...312f5c )
by Derek Stephen
07:27
created

Hidden   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 21
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTag() 0 4 1
A init() 0 9 1
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 19/11/2016
5
 * Time: 21:37
6
 */
7
8
namespace Del\Form\Field;
9
10
use Del\Form\Filter\Adapter\FilterAdapterZf;
11
use Zend\Filter\StringTrim;
12
use Zend\Filter\StripTags;
13
14
class Hidden extends FieldAbstract
15
{
16
    /**
17
     * @return string
18
     */
19 1
    public function getTag()
20
    {
21 1
        return 'input';
22
    }
23
24
25 1
    public function init()
26
    {
27 1
        $this->setAttribute('type', 'hidden');
28 1
        $this->setAttribute('class', 'form-control');
29 1
        $stringTrim = new FilterAdapterZf(new StringTrim());
30 1
        $stripTags = new FilterAdapterZf(new StripTags());
31 1
        $this->addFilter($stringTrim)
32 1
            ->addFilter($stripTags);
33
    }
34
}