Text   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A set() 0 5 1
1
<?php
2
3
namespace kalanis\kw_forms\Controls;
4
5
6
/**
7
 * Class Text
8
 * @package kalanis\kw_forms\Controls
9
 * Form element for text
10
 */
11
class Text extends AControl
12
{
13
    protected string $templateInput = '<input type="text" value="%1$s"%2$s />%3$s';
14
15
    /**
16
     * @param string $alias
17
     * @param string|int|float|null $value
18
     * @param string $label
19
     * @return $this
20
     */
21 16
    public function set(string $alias, $value = null, string $label = ''): self
22
    {
23 16
        $this->setEntry($alias, $value, $label);
24 16
        $this->setAttribute('id', $this->getKey());
25 16
        return $this;
26
    }
27
}
28