Automattic\WooCommerce\Vendor\Sabberworm\CSS\Value

URL::parsepublic staticWC 1.0

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

Хуков нет.

Возвращает

URL.

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

$result = URL::parse( $oParserState );
$oParserState(ParserState) (обязательный)
.

Код URL::parse() WC 10.4.3

public static function parse(ParserState $oParserState)
{
    $oAnchor = $oParserState->anchor();
    $sIdentifier = '';
    for ($i = 0; $i < 3; $i++) {
        $sChar = $oParserState->parseCharacter(true);
        if ($sChar === null) {
            break;
        }
        $sIdentifier .= $sChar;
    }
    $bUseUrl = $oParserState->streql($sIdentifier, 'url');
    if ($bUseUrl) {
        $oParserState->consumeWhiteSpace();
        $oParserState->consume('(');
    } else {
        $oAnchor->backtrack();
    }
    $oParserState->consumeWhiteSpace();
    $oResult = new URL(CSSString::parse($oParserState), $oParserState->currentLine());
    if ($bUseUrl) {
        $oParserState->consumeWhiteSpace();
        $oParserState->consume(')');
    }
    return $oResult;
}