Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
62.50% |
5 / 8 |
|
66.67% |
4 / 6 |
CRAP | |
0.00% |
0 / 1 |
| Comment | |
62.50% |
5 / 8 |
|
66.67% |
4 / 6 |
7.90 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| nodeType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| nodeName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| textContent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setTextContent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| shallowClone | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Html\Dom; |
| 6 | |
| 7 | final class Comment extends Node |
| 8 | { |
| 9 | public string $data; |
| 10 | |
| 11 | public function __construct(Document $ownerDocument, string $data = '') |
| 12 | { |
| 13 | parent::__construct($ownerDocument); |
| 14 | $this->data = $data; |
| 15 | } |
| 16 | |
| 17 | public function nodeType(): NodeType |
| 18 | { |
| 19 | return NodeType::Comment; |
| 20 | } |
| 21 | |
| 22 | public function nodeName(): string |
| 23 | { |
| 24 | return '#comment'; |
| 25 | } |
| 26 | |
| 27 | public function textContent(): string |
| 28 | { |
| 29 | return $this->data; |
| 30 | } |
| 31 | |
| 32 | public function setTextContent(string $text): void |
| 33 | { |
| 34 | $this->data = $text; |
| 35 | } |
| 36 | |
| 37 | protected function shallowClone(): static |
| 38 | { |
| 39 | $copy = new self($this->ownerDocument, $this->data); |
| 40 | /** @var static $copy */ |
| 41 | return $copy; |
| 42 | } |
| 43 | } |