Completed
Push — master ( dc27cd...c0eb3b )
by Rasmus
07:46
created

PasswordField   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderInput() 0 10 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 HTML <input type="password"> element.
10
 *
11
 * Note that, for security reasons, this Field type never echoes back it's value
12
 * when rendered.
13
 */
14
class PasswordField extends TextField
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 1
    public function renderInput(InputRenderer $renderer, InputModel $model, array $attr)
20
    {
21 1
        $attr['value'] = '';
22
23 1
        return $renderer->inputFor(
24 1
            $this,
25 1
            'password',
26 1
            $renderer->mergeAttrs(['maxlength' => $this->max_length], $attr)
27
        );
28
    }
29
}
30