| 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 |
||
| 81 | 43 | protected function run(): string |
|
| 82 | { |
||
| 83 | 43 | $tag = LabelTag::tag()->content( |
|
| 84 | 43 | $this->content ?? $this->getAttributeLabel() |
|
| 85 | ); |
||
| 86 | |||
| 87 | 43 | if ($this->setForAttribute) { |
|
| 88 | 39 | $id = $this->forId; |
|
| 89 | 39 | if ($id === null && $this->useInputIdAttribute) { |
|
| 90 | 30 | $id = $this->getInputId(); |
|
| 91 | } |
||
| 92 | 39 | if ($id !== null) { |
|
| 93 | 35 | $tag = $tag->forId($id); |
|
| 94 | } |
||
| 95 | } |
||
| 96 | |||
| 97 | 43 | if (!$this->encode) { |
|
| 98 | 1 | $tag = $tag->encode(false); |
|
| 99 | } |
||
| 100 | |||
| 101 | 43 | return $tag->render(); |
|
| 102 | } |
||
| 104 |