Guides

TreeNode
in package

FinalYes
Tags
template-covariant

of Node

Table of Contents

Properties

$children  : self[]
$node  : TNode
$parent  : self|self|null
$root  : TreeNode<string|int, DocumentNode>

Methods

addChild()  : void
createFromDocument()  : TreeNode<string|int, DocumentNode>
findPosition()  : int|null
getChildren()  : TreeNode<string|int, Node>[]
getNode()  : TNode
getParent()  : self|self|null
getRoot()  : self
isLastChildOfParent()  : bool
pushChild()  : void
release()  : void
Shadow trees are reference cycles (child to parent and to root), so without this they're only freed by the cycle collector, which also has to walk the whole AST.
removeChild()  : void
replaceChild()  : void
__construct()  : mixed
createFromCompoundNode()  : TreeNode<string|int, Node>[]
createFromNode()  : TreeNode<string|int, TValue>
setChildren()  : void

Properties

$parent

private self|self|null $parent = null

Methods

findPosition()

public findPosition(Node $node) : int|null
Parameters
$node : Node
Return values
int|null

getNode()

public getNode() : TNode
Return values
TNode

getParent()

public getParent() : self|self|null
Return values
self|self|null

getRoot()

public getRoot() : self
Return values
self

isLastChildOfParent()

public isLastChildOfParent() : bool
Return values
bool

release()

Shadow trees are reference cycles (child to parent and to root), so without this they're only freed by the cycle collector, which also has to walk the whole AST.

public release() : void

replaceChild()

public replaceChild(Node $oldChildNode, Node $newChildNode) : void
Parameters
$oldChildNode : Node
$newChildNode : Node

__construct()

private __construct(Node $node[, self|null $parent = null ]) : mixed
Parameters
$node : Node
$parent : self|null = null

createFromNode()

private static createFromNode(TValue $node, self|self $parent) : TreeNode<string|int, TValue>
Parameters
$node : TValue
$parent : self|self
Return values
TreeNode<string|int, TValue>

setChildren()

private setChildren(self[] $children) : void
Parameters
$children : self[]
On this page

Search results