HiddenField::renderInput()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 11
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 11
loc 11
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 7
nc 1
nop 3
crap 1
1
<?php
2
3
namespace mindplay\kissform\Fields;
4
5
use mindplay\kissform\InputModel;
6
use mindplay\kissform\InputRenderer;
7
8
/**
9
 * This class represents an <input type="hidden"> element
10
 */
11
class HiddenField extends TextField
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16 1 View Code Duplication
    public function renderInput(InputRenderer $renderer, InputModel $model, array $attr)
0 ignored issues
show
Duplication introduced by
This method 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...
17
    {
18 1
        return $renderer->tag(
19 1
            'input',
20
            $attr + [
21 1
                'type' => 'hidden',
22 1
                'name' => $renderer->getName($this),
23 1
                'value' => $model->getInput($this),
24
            ]
25
        );
26
    }
27
}
28