Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::querySelectorAllprivateWC 1.0

Метод класса: CssInliner{}

Хуков нет.

Возвращает

\DOMNodeList<\DOMNode>. the HTML elements that match the provided CSS $selectors

Использование

// private - только в коде основоного (родительского) класса
$result = $this->querySelectorAll( $selectors, $options ): \DOMNodeList;
$selectors(строка) (обязательный)
.
$options(массив)
.
По умолчанию: []

Код CssInliner::querySelectorAll() WC 10.4.3

private function querySelectorAll(string $selectors, array $options = []): \DOMNodeList
{
    try {
        $result = $this->getXPath()->query($this->getCssSelectorConverter()->toXPath($selectors));

        if ($result === false) {
            throw new \RuntimeException('query failed with selector \'' . $selectors . '\'', 1726533051);
        }

        return $result;
    } catch (ParseException $exception) {
        $alwaysThrowParseException = $options[self::QSA_ALWAYS_THROW_PARSE_EXCEPTION] ?? false;
        if ($this->debug || $alwaysThrowParseException) {
            throw $exception;
        }
        return new \DOMNodeList();
    } catch (\RuntimeException $exception) {
        if (
            $this->debug
        ) {
            throw $exception;
        }
        // `RuntimeException` indicates a bug in CssSelector so pass the message to the error handler.
        \trigger_error($exception->getMessage());
        return new \DOMNodeList();
    }
}