Documentation

NodeList
in package
implements ArrayAccess, IteratorAggregate, Countable

Tags
template

T of Node

phpstan-implements

ArrayAccess<int|string, T>

phpstan-implements

IteratorAggregate<T>

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
phpstan-var

array<T>

Methods

__construct()

public __construct(array<string|int, Node> $nodes) : mixed
Parameters
$nodes : array<string|int, Node>
Tags
phpstan-param

array<T> $nodes

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
phpstan-param

array<T> $nodes

phpstan-return

self<T>

Return values
self —

getIterator()

public getIterator() : Traversable
Return values
Traversable —

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
phpstan-return

T

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
phpstan-param

T|mixed[] $value

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
Tags
phpstan-return

NodeList<T>

Return values
NodeList —

Search results