TextArea::setPlaceholder()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 1
c 3
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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