Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
EndTagTk | |
0.00% |
0 / 11 |
|
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 / 7 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\Tokens; |
5 | |
6 | use Wikimedia\Parsoid\NodeData\DataMw; |
7 | use Wikimedia\Parsoid\NodeData\DataParsoid; |
8 | |
9 | /** |
10 | * Represents an HTML end tag token |
11 | */ |
12 | class EndTagTk extends Token { |
13 | /** @var string Name of the end tag */ |
14 | private $name; |
15 | |
16 | /** |
17 | * @param string $name |
18 | * @param KV[] $attribs |
19 | * @param ?DataParsoid $dataParsoid |
20 | * @param ?DataMw $dataMw |
21 | */ |
22 | public function __construct( |
23 | string $name, array $attribs = [], |
24 | ?DataParsoid $dataParsoid = null, ?DataMw $dataMw = null |
25 | ) { |
26 | parent::__construct( $dataParsoid, $dataMw ); |
27 | $this->name = $name; |
28 | $this->attribs = $attribs; |
29 | } |
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 | 'dataMw' => $this->dataMw, |
45 | ]; |
46 | } |
47 | } |