Automattic\WooCommerce\Vendor\Sabberworm\CSS\Parsing

ParserState::consumepublicWC 1.0

Method of the class: ParserState{}

No Hooks.

Returns

String.

Usage

$ParserState = new ParserState();
$ParserState->consume( $mValue );
$mValue(int)
.
Default: 1

ParserState::consume() code WC 10.4.3

public function consume($mValue = 1)
{
    if (is_string($mValue)) {
        $iLineCount = substr_count($mValue, "\n");
        $iLength = $this->strlen($mValue);
        if (!$this->streql($this->substr($this->iCurrentPosition, $iLength), $mValue)) {
            throw new UnexpectedTokenException($mValue, $this->peek(max($iLength, 5)), $this->iLineNo);
        }
        $this->iLineNo += $iLineCount;
        $this->iCurrentPosition += $this->strlen($mValue);
        return $mValue;
    } else {
        if ($this->iCurrentPosition + $mValue > $this->iLength) {
            throw new UnexpectedEOFException($mValue, $this->peek(5), 'count', $this->iLineNo);
        }
        $sResult = $this->substr($this->iCurrentPosition, $mValue);
        $iLineCount = substr_count($sResult, "\n");
        $this->iLineNo += $iLineCount;
        $this->iCurrentPosition += $mValue;
        return $sResult;
    }
}