FieldTypePassword::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 10
1
<?php
2
3
namespace Itstructure\FieldWidgets;
4
5
use yii\helpers\ArrayHelper;
6
7
/**
8
 * Class FieldTypePassword
9
 * Class for printing the form password field.
10
 *
11
 * @package Itstructure\FieldWidgets
12
 */
13
class FieldTypePassword extends FieldType
14
{
15
    /**
16
     * @return string
17
     */
18
    public function run(): string
19
    {
20
        return $this->getField()
21
            ->passwordInput(
22
                ArrayHelper::merge(
23
                    [
24
                        'maxlength' => true
25
                    ],
26
                    $this->getOptions()
27
                )
28
            )
29
            ->label($this->getLabel());
30
    }
31
}
32