TextArea   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
eloc 11
c 3
b 0
f 0
dl 0
loc 26
ccs 14
cts 14
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setPlaceholder() 0 3 1
A getTag() 0 3 1
A getPlaceholder() 0 3 1
A init() 0 9 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 Del\Form\Renderer\Field\TextAreaRender;
9
use Laminas\Filter\StringTrim;
10
use Laminas\Filter\StripTags;
11
12
class TextArea extends FieldAbstract
13
{
14 1
    public function getTag(): string
15
    {
16 1
        return 'textarea';
17
    }
18
19 2
    public function init()
20
    {
21 2
        $this->setAttribute('type', 'text');
22 2
        $this->setAttribute('class', 'form-control');
23 2
        $stringTrim = new FilterAdapterZf(new StringTrim());
24 2
        $stripTags = new FilterAdapterZf(new StripTags());
25 2
        $this->addFilter($stringTrim);
26 2
        $this->addFilter($stripTags);
27 2
        $this->setRenderer(new TextAreaRender());
28
    }
29
30 1
    public function getPlaceholder(): string
31
    {
32 1
        return $this->getAttribute('placeholder');
33
    }
34
35 1
    public function setPlaceholder(string $placeholder): void
36
    {
37 1
        $this->setAttribute('placeholder', $placeholder);
38
    }
39
}
40