Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 9 |
SelfclosingTagTk | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 9 |
__construct | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 4 |
|||
getName | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
jsonSerialize | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
<?php | |
declare( strict_types = 1 ); | |
namespace Wikimedia\Parsoid\Tokens; | |
use Wikimedia\Parsoid\NodeData\DataParsoid; | |
/** | |
* Token for a self-closing tag (HTML or otherwise) | |
*/ | |
class SelfclosingTagTk extends Token { | |
/** @var string Name of the end tag */ | |
private $name; | |
/** | |
* @param string $name | |
* @param KV[] $attribs | |
* @param ?DataParsoid $dataAttribs | |
*/ | |
public function __construct( | |
string $name, array $attribs = [], ?DataParsoid $dataAttribs = null | |
) { | |
$this->name = $name; | |
$this->attribs = $attribs; | |
$this->dataAttribs = $dataAttribs ?? new DataParsoid; | |
} | |
/** | |
* @return string | |
*/ | |
public function getName(): string { | |
return $this->name; | |
} | |
/** | |
* @inheritDoc | |
*/ | |
public function jsonSerialize(): array { | |
return [ | |
'type' => $this->getType(), | |
'name' => $this->name, | |
'attribs' => $this->attribs, | |
'dataAttribs' => $this->dataAttribs | |
]; | |
} | |
} |