TLabel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setLabel() 0 3 1
A getLabel() 0 3 1
1
<?php
2
3
namespace kalanis\kw_forms\Controls;
4
5
6
/**
7
 * Wrapper trait for form labels
8
 * @author Petr Plsek
9
 * @author Adam Dornak
10
 */
11
trait TLabel
12
{
13
    protected ?string $label = null;
14
15
    /**
16
     * 1 id(for=""), 2 labelText,  3 attributes
17
     * @var string
18
     */
19
    protected string $templateLabel = '<label for="%1$s"%3$s>%2$s</label>';
20
21
    /**
22
     * Set object label
23
     * @param string $value
24
     */
25 82
    public function setLabel(?string $value): void
26
    {
27 82
        $this->label = $value;
28 82
    }
29
30
    /**
31
     * Returns object label
32
     * @return string|null
33
     */
34 19
    public function getLabel(): ?string
35
    {
36 19
        return $this->label;
37
    }
38
}
39