Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor

AbstractHtmlProcessor::getHtmlElementprotectedWC 1.0

Returns the HTML element.

This method assumes that there always is an HTML element, throwing an exception otherwise.

Method of the class: AbstractHtmlProcessor{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->getHtmlElement(): \DOMElement;

AbstractHtmlProcessor::getHtmlElement() code WC 10.8.1

protected function getHtmlElement(): \DOMElement
{
    $htmlElement = $this->getDomDocument()->getElementsByTagName('html')->item(0);
    if (!$htmlElement instanceof \DOMElement) {
        throw new \UnexpectedValueException('There is no HTML element although there should be one.', 1569930853);
    }

    return $htmlElement;
}