Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
HtmlTextElement | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
get | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
set | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\Core\Html; |
6 | |
7 | use DOMText; |
8 | use PeServer\Core\Html\HtmlDocument; |
9 | use PeServer\Core\Html\HtmlNodeBase; |
10 | |
11 | /** |
12 | * `DOMText` ラッパー。 |
13 | * |
14 | */ |
15 | final class HtmlTextElement extends HtmlNodeBase |
16 | { |
17 | #region variable |
18 | |
19 | /** |
20 | */ |
21 | public readonly DOMText $raw; |
22 | |
23 | #endregion |
24 | |
25 | public function __construct(HtmlDocument $document, DOMText $raw) |
26 | { |
27 | parent::__construct($document, $raw); |
28 | $this->raw = $raw; |
29 | } |
30 | |
31 | #region function |
32 | |
33 | public function get(): string |
34 | { |
35 | return $this->raw->textContent; |
36 | } |
37 | |
38 | public function set(string $value): void |
39 | { |
40 | $this->raw->textContent = $value; |
41 | } |
42 | |
43 | #endregion |
44 | } |