TLabel::getLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
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