Test Failed
Pull Request — master (#159)
by Sergei
03:08
created

FieldFactoryConfig::getSetInputIdAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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