Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
Label
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
 for
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Epic64\Elem\Elements;
6
7use Epic64\Elem\Element;
8
9class Label extends Element
10{
11    public function __construct(?string $text = null, ?string $for = null)
12    {
13        parent::__construct('label', $text);
14        if ($for !== null) {
15            $this->element->setAttribute('for', $for);
16        }
17    }
18
19    public function for(string $for): static
20    {
21        return $this->attr('for', $for);
22    }
23}