TextArea::render()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: fsilva
5
 * Date: 10-02-2016
6
 * Time: 18:39
7
 */
8
9
namespace Slick\Form\Renderer;
10
11
12 View Code Duplication
class TextArea extends Input
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
15
    /**
16
     * @var string The template file to use in the rendering
17
     */
18
    public $template = 'form-inputs/textarea.twig';
19
20
    /**
21
     * Overrides to remove the unnecessary value attribute
22
     * @param array $context
23
     * @return string
24
     */
25 2
    public function render($context = [])
26
    {
27 2
        if ($this->getElement()->hasAttribute('value')) {
28 2
            $this->getElement()->getAttributes()->remove('value');
29 2
        }
30 2
        return parent::render($context);
31
    }
32
}