TextArea::setValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.1481

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 6
cp 0.6667
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2.1481
1
<?php
2
3
/**
4
 * This file is part of slick/form package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Form\Input;
11
12
use Slick\Form\InputInterface;
13
use Slick\Form\Renderer\TextArea as AreaRenderer;
14
15
/**
16
 * Text Area input
17
 *
18
 * @package Slick\Form\Input
19
 * @author  Filipe Silva <[email protected]>
20
 */
21
class TextArea extends AbstractInput implements InputInterface
22
{
23
24
    /**
25
     * @var string Renderer class
26
     */
27
    protected $rendererClass = AreaRenderer::class;
28
29
    /**
30
     * Adds the value to the select
31
     *
32
     * Mainly it removes the entry in the attributes list
33
     *
34
     * @param mixed $value
35
     *
36
     * @return $this|self|Select
37
     */
38 4
    public function setValue($value)
39
    {
40 4
        parent::setValue($value);
41 4
        if ($this->hasAttribute('value')) {
42
            $this->getAttributes()->remove('value');
43
        }
44 4
        return $this;
45
    }
46
}