Automattic\WooCommerce\EmailEditorVendor\Sabberworm\CSS\CSSList

CSSList::parseList │ public static │ WC 1.0

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

Хуков нет.

Возвращает

void. Ничего (null).

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

$result = CSSList::parseList( $oParserState, $oList );
$oParserState(ParserState) (обязательный)
.
$oList(CSSList) (обязательный)
.

Код CSSList::parseList() WC 11.3.0

public static function parseList(ParserState $oParserState, CSSList $oList)
{
    $bIsRoot = $oList instanceof Document;
    if (is_string($oParserState)) {
        $oParserState = new ParserState($oParserState, Settings::create());
    }
    $bLenientParsing = $oParserState->getSettings()->bLenientParsing;
    $aComments = [];
    while (!$oParserState->isEnd()) {
        $aComments = array_merge($aComments, $oParserState->consumeWhiteSpace());
        $oListItem = null;
        if ($bLenientParsing) {
            try {
                $oListItem = self::parseListItem($oParserState, $oList);
            } catch (UnexpectedTokenException $e) {
                $oListItem = false;
            }
        } else {
            $oListItem = self::parseListItem($oParserState, $oList);
        }
        if ($oListItem === null) {
            // List parsing finished
            return;
        }
        if ($oListItem) {
            $oListItem->addComments($aComments);
            $oList->append($oListItem);
        }
        $aComments = $oParserState->consumeWhiteSpace();
    }
    $oList->addComments($aComments);
    if (!$bIsRoot && !$bLenientParsing) {
        throw new SourceException("Unexpected end of document", $oParserState->currentLine());
    }
}