Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
EndTagTk | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
jsonSerialize | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\Tokens; |
5 | |
6 | use Wikimedia\Parsoid\NodeData\DataParsoid; |
7 | |
8 | /** |
9 | * Represents an HTML end tag token |
10 | */ |
11 | class EndTagTk extends Token { |
12 | /** @var string Name of the end tag */ |
13 | private $name; |
14 | |
15 | /** |
16 | * @param string $name |
17 | * @param KV[] $attribs |
18 | * @param ?DataParsoid $dataParsoid |
19 | */ |
20 | public function __construct( |
21 | string $name, array $attribs = [], ?DataParsoid $dataParsoid = null |
22 | ) { |
23 | $this->name = $name; |
24 | $this->attribs = $attribs; |
25 | $this->dataParsoid = $dataParsoid ?? new DataParsoid; |
26 | } |
27 | |
28 | /** |
29 | * @return string |
30 | */ |
31 | public function getName(): string { |
32 | return $this->name; |
33 | } |
34 | |
35 | /** |
36 | * @inheritDoc |
37 | */ |
38 | public function jsonSerialize(): array { |
39 | return [ |
40 | 'type' => $this->getType(), |
41 | 'name' => $this->name, |
42 | 'attribs' => $this->attribs, |
43 | 'dataParsoid' => $this->dataParsoid |
44 | ]; |
45 | } |
46 | } |