WooCommerce Code Reference

Parser
in package

This class parses CSS from text into a data structure.

Table of Contents

$oParserState  : ParserState
__construct()  : mixed
getCharset()  : void
Returns the charset that is used if the CSS does not contain an `@charset` declaration.
parse()  : Document
Parses the CSS provided to the constructor and creates a `Document` from it.
setCharset()  : void
Sets the charset to be used if the CSS does not contain an `@charset` declaration.

Properties

Methods

__construct()

public __construct(string $sText[, Settings|null $oParserSettings = null ][, int $iLineNo = 1 ]) : mixed
Parameters
$sText : string

the complete CSS as text (i.e., usually the contents of a CSS file)

$oParserSettings : Settings|null = null
$iLineNo : int = 1

the line number (starting from 1, not from 0)

Return values
mixed

getCharset()

Returns the charset that is used if the CSS does not contain an `@charset` declaration.

public getCharset() : void
Tags
deprecated

since 8.7.0, will be removed in version 9.0.0 with #687

Return values
void

setCharset()

Sets the charset to be used if the CSS does not contain an `@charset` declaration.

public setCharset(string $sCharset) : void
Parameters
$sCharset : string
Tags
deprecated

since 8.7.0, will be removed in version 9.0.0 with #687

Return values
void