Test Failed
Pull Request — master (#159)
by Sergei
02:23
created

FieldFactoryConfig::inputTextConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Form;
6
7
use Yiisoft\Html\Tag\Label;
8
9
final class FieldFactoryConfig
10
{
11
    private ?string $template = null;
12
13
    private ?bool $setInputIdAttribute = null;
14
15
    private ?Label $labelTag = null;
16
    private ?bool $setLabelForAttribute = null;
17
18
    private array $inputTextConfig = [];
19
20
    public function template(?string $template): self
21
    {
22
        $new = clone $this;
23
        $new->template = $template;
24
        return $new;
25
    }
26
27
    public function setInputIdAttribute(?bool $value): self
28
    {
29
        $new = clone $this;
30
        $new->setInputIdAttribute = $value;
31
        return $new;
32
    }
33
34
    public function labelTag(?Label $tag): self
35
    {
36
        $new = clone $this;
37
        $new->labelTag = $tag;
38
        return $new;
39
    }
40
41
    public function setLabelForAttribute(?bool $value): self
42
    {
43
        $new = clone $this;
44
        $new->setLabelForAttribute = $value;
45
        return $new;
46
    }
47
48
    public function inputTextConfig(array $config): self
49
    {
50
        $new = clone $this;
51
        $new->inputTextConfig = $config;
52
        return $new;
53
    }
54
55
    public function getTemplate(): ?string
56
    {
57
        return $this->template;
58
    }
59
60
    public function getSetInputIdAttribute(): ?bool
61
    {
62
        return $this->setInputIdAttribute;
63
    }
64
65
    public function getLabelTag(): ?Label
66
    {
67
        return $this->labelTag;
68
    }
69
70
    public function getSetLabelForAttribute(): ?bool
71
    {
72
        return $this->setLabelForAttribute;
73
    }
74
75
    public function getInputTextConfig(): array
76
    {
77
        return $this->inputTextConfig;
78
    }
79
}
80