Text   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 2
b 0
f 0
dl 0
loc 25
ccs 13
cts 13
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setPlaceholder() 0 3 1
A init() 0 8 1
A getTag() 0 3 1
A getPlaceholder() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Form\Field;
6
7
use Del\Form\Filter\Adapter\FilterAdapterZf;
8
use Laminas\Filter\StringTrim;
9
use Laminas\Filter\StripTags;
10
11
class Text extends FieldAbstract
12
{
13 14
    public function getTag(): string
14
    {
15 14
        return 'input';
16
    }
17
18 36
    public function init()
19
    {
20 36
        $this->setAttribute('type', 'text');
21 36
        $this->setAttribute('class', 'form-control');
22 36
        $stringTrim = new FilterAdapterZf(new StringTrim());
23 36
        $stripTags = new FilterAdapterZf(new StripTags());
24 36
        $this->addFilter($stringTrim);
25 36
        $this->addFilter($stripTags);
26
    }
27
28 1
    public function getPlaceholder(): string
29
    {
30 1
        return $this->getAttribute('placeholder');
31
    }
32
33 6
    public function setPlaceholder(string $placeholder): void
34
    {
35 6
        $this->setAttribute('placeholder', $placeholder);
36
    }
37
}
38