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