NodeList
in package
implements
ArrayAccess, IteratorAggregate, Countable
Tags
Interfaces, Classes, Traits and Enums
- ArrayAccess
- IteratorAggregate
- Countable
Table of Contents
- $nodes : array<string|int, Node>
- __construct() : mixed
- count() : int
- create() : self
- getIterator() : Traversable
- merge() : NodeList
- offsetExists() : bool
- offsetGet() : mixed
- TODO enable strict typing by changing how the Visitor deals with NodeList.
- offsetSet() : void
- offsetUnset() : void
- splice() : NodeList
Properties
$nodes
private
array<string|int, Node>
$nodes
Tags
Methods
__construct()
public
__construct(array<string|int, Node> $nodes) : mixed
Parameters
- $nodes : array<string|int, Node>
Tags
Return values
mixed —count()
public
count() : int
Return values
int —create()
public
static create(array<string|int, Node> $nodes) : self
Parameters
- $nodes : array<string|int, Node>
Tags
Return values
self —getIterator()
public
getIterator() : Traversable
Return values
Traversable —merge()
public
merge(NodeList|array<string|int, Node> $list) : NodeList
Parameters
Tags
Return values
NodeList —offsetExists()
public
offsetExists(int|string $offset) : bool
Parameters
- $offset : int|string
Return values
bool —offsetGet()
TODO enable strict typing by changing how the Visitor deals with NodeList.
public
offsetGet(int|string $offset) : mixed
Ideally, this function should always return a Node instance. However, the Visitor currently allows mutation of the NodeList and puts arbitrary values in the NodeList, such as strings. We will have to switch to using an array or a less strict type instead so we can enable strict typing in this class.
Parameters
- $offset : int|string
Tags
Return values
mixed —offsetSet()
public
offsetSet(int|string|null $offset, Node|array<string|int, mixed> $value) : void
Parameters
- $offset : int|string|null
- $value : Node|array<string|int, mixed>
Tags
Return values
void —offsetUnset()
public
offsetUnset(int|string $offset) : void
Parameters
- $offset : int|string
Return values
void —splice()
public
splice(int $offset, int $length[, mixed $replacement = null ]) : NodeList
Parameters
- $offset : int
- $length : int
- $replacement : mixed = null