Completed
Push — master ( ad129c...1d4a66 )
by Filipe
16:47
created

Select::render()   A

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
/**
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\Renderer;
11
12
/**
13
 * HTML Select renderer
14
 *
15
 * @package Slick\Form\Renderer
16
 */
17 View Code Duplication
class Select 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...
18
{
19
20
    /**
21
     * @var string The template file to use in the rendering
22
     */
23
    public $template = 'form-inputs/select.twig';
24
25
    /**
26
     * Overrides to remove the unnecessary value attribute
27
     * @param array $context
28
     * @return string
29
     */
30 2
    public function render($context = [])
31
    {
32 2
        if ($this->getElement()->hasAttribute('value')) {
33 2
            $this->getElement()->getAttributes()->remove('value');
34 1
        }
35 2
        return parent::render($context);
36
    }
37
}