ListNode
extends CompoundNode
in package
FinalYes
Table of Contents
Properties
- $classes : array<string|int, string>
- $options : array<string, scalar|null>
- $value : TValue
- $ordered : bool
- $orderingType : string|null
- $start : string|null
Methods
- __construct() : mixed
- addChildNode() : void
- getChildren() : array<string|int, TValue>
- getClasses() : array<string|int, string>
- getClassesString() : string
- getOption() : mixed
- getOptions() : array<string, scalar|null>
- getOrderingType() : string|null
- getStart() : string|null
- getValue() : TValue
- hasOption() : bool
- isOrdered() : bool
- pushChildNode() : void
- removeNode() : self
- replaceNode() : self
- setClasses() : void
- Normalizes class names following the rules of identifier-normalization
- setOrderingType() : ListNode
- setStart() : ListNode
- setValue() : void
- withKeepExistingOptions() : static
- Adds $options as default options without overriding any options already set.
- withOptions() : static
Properties
$classes
protected
array<string|int, string>
$classes
= []
$options
protected
array<string, scalar|null>
$options
= []
$value
protected
TValue
$value
$ordered read-only
private
bool
$ordered
= false
$orderingType
private
string|null
$orderingType
= null
$start
private
string|null
$start
= null
Methods
__construct()
public
__construct(array<string|int, ListItemNode> $items[, bool $ordered = false ][, string|null $start = null ][, string|null $orderingType = null ]) : mixed
Parameters
- $items : array<string|int, ListItemNode>
- $ordered : bool = false
- $start : string|null = null
- $orderingType : string|null = null
addChildNode()
public
addChildNode(TValue $node) : void
Parameters
- $node : TValue
getChildren()
public
getChildren() : array<string|int, TValue>
Return values
array<string|int, TValue>getClasses()
public
getClasses() : array<string|int, string>
Return values
array<string|int, string>getClassesString()
public
getClassesString() : string
Return values
stringgetOption()
public
getOption(string $name[, TType|null $default = null ]) : mixed
Parameters
- $name : string
- $default : TType|null = null
Tags
getOptions()
public
getOptions() : array<string, scalar|null>
Return values
array<string, scalar|null>getOrderingType()
public
getOrderingType() : string|null
Return values
string|nullgetStart()
public
getStart() : string|null
Return values
string|nullgetValue()
public
getValue() : TValue
Return values
TValuehasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolisOrdered()
public
isOrdered() : bool
Return values
boolpushChildNode()
public
pushChildNode(TValue $node) : void
Parameters
- $node : TValue
removeNode()
public
removeNode(int $key) : self
Parameters
- $key : int
Tags
Return values
selfreplaceNode()
public
replaceNode(int $key, TValue $node) : self
Parameters
- $key : int
- $node : TValue
Tags
Return values
selfsetClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(array<string|int, string> $classes) : void
Parameters
- $classes : array<string|int, string>
Tags
setOrderingType()
public
setOrderingType(string|null $orderingType) : ListNode
Parameters
- $orderingType : string|null
Return values
ListNodesetStart()
public
setStart(string|null $start) : ListNode
Parameters
- $start : string|null
Return values
ListNodesetValue()
public
setValue(TValue $value) : void
Parameters
- $value : TValue
withKeepExistingOptions()
Adds $options as default options without overriding any options already set.
public
withKeepExistingOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>
Return values
staticwithOptions()
public
withOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>