WooCommerce Code Reference

Rule
in package
implements Commentable, CSSElement, Positionable Uses Position

`Rule`s just have a string key (the rule) and a 'Value'.

In CSS, Rules are expressed as follows: “key: value[0][0] value[0][1], value[1][0] value[1][1];”

Interfaces, Classes and Traits

Commentable
CSSElement
Represents any entity in the CSS that is encapsulated by a class.
Positionable
Represents a CSS item that may have a position in the source CSS document (line number and possibly column number).

Table of Contents

$aIeHack  : array<int, int>
$bIsImportant  : bool
$mValue  : RuleValueList|string|null
$sRule  : string
__construct()  : mixed
__toString()  : string
addComments()  : void
addIeHack()  : void
addValue()  : void
Adds a value to the existing value. Value will be appended if a `RuleValueList` exists of the given type.
getComments()  : array<array-key, Comment>
getIeHack()  : array<int, int>
getIsImportant()  : bool
getRule()  : string
getValue()  : RuleValueList|string|null
getValues()  : array<int, array<int, RuleValueList>>
render()  : string
setComments()  : void
setIeHack()  : void
setIsImportant()  : void
setRule()  : void
setValue()  : void
setValues()  : RuleValueList
listDelimiterForRule()  : array<int, non-empty-string>
Returns a list of delimiters (or separators).

Properties

Methods

__construct()

public __construct(string $sRule, int $iLineNo, int $iColNo) : mixed
Parameters
$sRule : string
$iLineNo : int
$iColNo : int
Return values
mixed

addIeHack()

public addIeHack(int $iModifier) : void
Parameters
$iModifier : int
Tags
deprecated

since V8.8.0, will be removed in V9.0

Return values
void

getValues()

public getValues() : array<int, array<int, RuleValueList>>
Tags
deprecated

will be removed in version 9.0 Old-Style 2-dimensional array returned. Retained for (some) backwards-compatibility. Use getValue() instead and check for the existence of a (nested set of) ValueList object(s).

Return values
array<int, array<int, RuleValueList>>

setIeHack()

public setIeHack(array<int, int> $aModifiers) : void
Parameters
$aModifiers : array<int, int>
Tags
deprecated

since V8.8.0, will be removed in V9.0

Return values
void

setValues()

public setValues(array<array-key, array<array-key, RuleValueList>> $aSpaceSeparatedValues) : RuleValueList
Parameters
$aSpaceSeparatedValues : array<array-key, array<array-key, RuleValueList>>
Tags
deprecated

will be removed in version 9.0 Old-Style 2-dimensional array given. Retained for (some) backwards-compatibility. Use setValue() instead and wrap the value inside a RuleValueList if necessary.

Return values
RuleValueList

listDelimiterForRule()

Returns a list of delimiters (or separators).

private static listDelimiterForRule(string $sRule) : array<int, non-empty-string>

The first item is the innermost separator (or, put another way, the highest-precedence operator). The sequence continues to the outermost separator (or lowest-precedence operator).

Parameters
$sRule : string
Return values
array<int, non-empty-string>