EmptyControl::renderInput()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace kalanis\kw_tree_controls\Controls;
4
5
6
use kalanis\kw_forms\Controls\Text;
7
use kalanis\kw_forms\Exceptions\RenderException;
8
9
10
/**
11
 * Class EmptyControl
12
 * @package kalanis\kw_tree_controls\Controls
13
 * Just when you need control entity without that control input
14
 */
15
class EmptyControl extends Text
16
{
17
    protected string $templateInput = '%3$s';
18
19 1
    public function getValue()
20
    {
21 1
        return null;
22
    }
23
24 1
    public function setValue(/** @scrutinizer ignore-unused */ $value): void
25
    {
26
        // intentionally nothing
27 1
    }
28
29
    /**
30
     * Return input entry in HTML
31
     * @param string|string[]|array|null $attributes
32
     * @throws RenderException
33
     * @return string
34
     */
35 3
    public function renderInput($attributes = null): string
36
    {
37 3
        return $this->wrapIt(sprintf($this->templateInput, '', '', $this->renderChildren()), $this->wrappersInput);
38
    }
39
}
40