Passed
Push — master ( acf3f9...98cfe3 )
by Derek Stephen
03:04
created

Hidden   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 19
ccs 9
cts 9
cp 1
rs 10

2 Methods

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