Completed
Push — master ( 4e2c55...2c21d8 )
by Andrey
01:28
created

FieldTypeText::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 12
Ratio 85.71 %

Importance

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