Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
DOMBuilder | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
createDocument | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\Wt2Html\TreeBuilder; |
5 | |
6 | use Wikimedia\Parsoid\Utils\DOMCompat; |
7 | use Wikimedia\RemexHtml\DOM\DOMBuilder as RemexDOMBuilder; |
8 | |
9 | /** |
10 | * This is the DOMBuilder subclass used by Wt2Html |
11 | */ |
12 | class DOMBuilder extends RemexDOMBuilder { |
13 | public function __construct() { |
14 | parent::__construct( [ |
15 | 'suppressHtmlNamespace' => true, |
16 | # 'suppressIdAttribute' => true, |
17 | #'domExceptionClass' => \Wikimdedia\Dodo\DOMException::class, |
18 | ] ); |
19 | } |
20 | |
21 | /** |
22 | * @param string|null $doctypeName |
23 | * @param string|null $public |
24 | * @param string|null $system |
25 | * @return \DOMDocument |
26 | */ |
27 | protected function createDocument( |
28 | ?string $doctypeName = null, |
29 | ?string $public = null, |
30 | ?string $system = null |
31 | ) { |
32 | // @phan-suppress-next-line PhanTypeMismatchReturn |
33 | return DOMCompat::newDocument( $doctypeName === 'html' ); |
34 | } |
35 | } |