Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 4
DOMBuilder
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 4
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 3
 createDocument
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
declare( strict_types = 1 );
namespace Wikimedia\Parsoid\Wt2Html\TreeBuilder;
use Wikimedia\Parsoid\Utils\DOMCompat;
use Wikimedia\RemexHtml\DOM\DOMBuilder as RemexDOMBuilder;
/**
 * This is the DOMBuilder subclass used by Wt2Html
 */
class DOMBuilder extends RemexDOMBuilder {
    public function __construct() {
        parent::__construct( [
            'suppressHtmlNamespace' => true,
            # 'suppressIdAttribute' => true,
            #'domExceptionClass' => \Wikimdedia\Dodo\DOMException::class,
        ] );
    }
    /**
     * @param string|null $doctypeName
     * @param string|null $public
     * @param string|null $system
     * @return \DOMDocument
     */
    protected function createDocument(
        string $doctypeName = null,
        string $public = null,
        string $system = null
    ) {
        // @phan-suppress-next-line PhanTypeMismatchReturn
        return DOMCompat::newDocument( $doctypeName === 'html' );
    }
}