| Total Complexity | 6 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Label extends AbstractHtmlElement |
||
| 8 | { |
||
| 9 | protected string $content; |
||
| 10 | |||
| 11 | protected ?string $for = null; |
||
| 12 | |||
| 13 | 6 | public function __construct(string $content) |
|
| 14 | { |
||
| 15 | 6 | $this->content = $content; |
|
| 16 | |||
| 17 | 6 | parent::__construct(); |
|
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Get the value of content |
||
| 22 | * |
||
| 23 | * @return string |
||
| 24 | */ |
||
| 25 | 6 | public function getContent(): string |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Get the value of for |
||
| 32 | * |
||
| 33 | * @return mixed |
||
| 34 | */ |
||
| 35 | 3 | public function getFor() |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Set the value of for |
||
| 42 | * |
||
| 43 | * @param mixed $for |
||
| 44 | * |
||
| 45 | * @return $this |
||
| 46 | */ |
||
| 47 | 6 | public function setFor($for): Label |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return $this |
||
| 56 | */ |
||
| 57 | 3 | protected function resolveAttributes(): Label |
|
| 58 | { |
||
| 59 | 3 | parent::resolveAttributes() |
|
| 60 | 3 | ->addAttribute('for', $this->for); |
|
| 61 | |||
| 62 | 3 | return $this; |
|
| 63 | } |
||
| 64 | |||
| 65 | 3 | protected function renderHtmlMarkup(): string |
|
| 68 | } |
||
| 69 | } |
||
| 70 |