css-sanitizer
Classes to parse and sanitize CSS
|
Represent a list of CSS objects. More...
Public Member Functions | |
__construct (array $objects=[]) | |
add ( $objects, $index=null) | |
Insert one or more objects into the list. | |
remove ( $index) | |
Remove an object from the list. | |
slice ( $offset, $length=null) | |
Extract a slice of the list. | |
clear () | |
Clear the list. | |
count () | |
@inheritDoc | |
seek (int $offset) | |
@inheritDoc | |
current () | |
@inheritDoc | |
key () | |
@inheritDoc | |
next () | |
@inheritDoc | |
rewind () | |
@inheritDoc | |
valid () | |
@inheritDoc | |
offsetExists ( $offset) | |
@inheritDoc | |
offsetGet ( $offset) | |
@inheritDoc | |
offsetSet ( $offset, $value) | |
@inheritDoc | |
offsetUnset ( $offset) | |
@inheritDoc | |
getPosition () | |
@inheritDoc | |
toTokenArray () | |
@inheritDoc | |
toComponentValueArray () | |
@inheritDoc | |
__toString () | |
Protected Member Functions | |
getSeparator (CSSObject $left, ?CSSObject $right=null) | |
Return the tokens to use to separate list items. | |
Static Protected Member Functions | |
static | testObjects (array $objects) |
Additional validation for objects. | |
Protected Attributes | |
$objects | |
$offset = 0 | |
Static Protected Attributes | |
static | $objectType |
Represent a list of CSS objects.
Wikimedia\CSS\Objects\CSSObjectList::__construct | ( | array | $objects = [] | ) |
CSSObject[] | $objects |
Wikimedia\CSS\Objects\CSSObjectList::add | ( | $objects, | |
$index = null ) |
Insert one or more objects into the list.
CSSObject | CSSObject[] | CSSObjectList | $objects | An object to add, or an array of objects. |
int | null | $index | Insert the objects at this index. If omitted, the objects are added at the end. |
Wikimedia\CSS\Objects\CSSObjectList::getPosition | ( | ) |
@inheritDoc
Implements Wikimedia\CSS\Objects\CSSObject.
|
protected |
Return the tokens to use to separate list items.
CSSObject | $left | |
CSSObject | null | $right |
Reimplemented in Wikimedia\CSS\Objects\DeclarationList, Wikimedia\CSS\Objects\DeclarationOrAtRuleList, and Wikimedia\CSS\Objects\RuleList.
Wikimedia\CSS\Objects\CSSObjectList::remove | ( | $index | ) |
Remove an object from the list.
int | $index |
Wikimedia\CSS\Objects\CSSObjectList::slice | ( | $offset, | |
$length = null ) |
Extract a slice of the list.
int | $offset | |
int | null | $length |
|
staticprotected |
Additional validation for objects.
CSSObject[] | $objects |
Reimplemented in Wikimedia\CSS\Objects\ComponentValueList.
Wikimedia\CSS\Objects\CSSObjectList::toComponentValueArray | ( | ) |
@inheritDoc
Implements Wikimedia\CSS\Objects\CSSObject.
Reimplemented in Wikimedia\CSS\Objects\ComponentValueList, and Wikimedia\CSS\Objects\TokenList.
Wikimedia\CSS\Objects\CSSObjectList::toTokenArray | ( | ) |
@inheritDoc
Implements Wikimedia\CSS\Objects\CSSObject.
Reimplemented in Wikimedia\CSS\Objects\TokenList.