Conditions | 6 |
Paths | 10 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
74 | 57 | protected function run(): string |
|
75 | { |
||
76 | 57 | $tag = LabelTag::tag()->content( |
|
77 | 57 | $this->content ?? $this->getAttributeLabel() |
|
78 | ); |
||
79 | |||
80 | 57 | if ($this->setForAttribute) { |
|
81 | 53 | $id = $this->forId; |
|
82 | 53 | if ($id === null && $this->useInputIdAttribute) { |
|
83 | 45 | $id = $this->getInputId(); |
|
84 | } |
||
85 | 53 | if ($id !== null) { |
|
86 | 49 | $tag = $tag->forId($id); |
|
87 | } |
||
88 | } |
||
89 | |||
90 | 57 | if (!$this->encode) { |
|
91 | 1 | $tag = $tag->encode(false); |
|
92 | } |
||
93 | |||
94 | 57 | return $tag->render(); |
|
95 | } |
||
97 |