Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| Meta | |
100.00% |
10 / 10 |
|
100.00% |
4 / 4 |
7 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
4 | |||
| charset | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| name | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| content | |
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 Meta extends Element |
| 10 | { |
| 11 | public function __construct(?string $charset = null, ?string $name = null, ?string $content = null) |
| 12 | { |
| 13 | parent::__construct('meta'); |
| 14 | if ($charset !== null) { |
| 15 | $this->element->setAttribute('charset', $charset); |
| 16 | } |
| 17 | if ($name !== null) { |
| 18 | $this->element->setAttribute('name', $name); |
| 19 | } |
| 20 | if ($content !== null) { |
| 21 | $this->element->setAttribute('content', $content); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | public function charset(string $charset): static |
| 26 | { |
| 27 | return $this->attr('charset', $charset); |
| 28 | } |
| 29 | |
| 30 | public function name(string $name): static |
| 31 | { |
| 32 | return $this->attr('name', $name); |
| 33 | } |
| 34 | |
| 35 | public function content(string $content): static |
| 36 | { |
| 37 | return $this->attr('content', $content); |
| 38 | } |
| 39 | } |