Documentation

TreeNode
in package
implements Countable, IteratorAggregate

FinalYes
Tags
implements
author

Simon André smn.andre@gmail.com

Table of Contents

Interfaces

Countable
IteratorAggregate

Properties

$children  : array<string|int, TreeNode|callable(): Generator>
$value  : string

Methods

__construct()  : mixed
__toString()  : string
addChild()  : self
count()  : int
fromValues()  : self
getChildren()  : Traversable<int, TreeNode>
getIterator()  : Traversable<int, TreeNode>
getValue()  : string

Properties

$children

private array<string|int, TreeNode|callable(): Generator> $children = []

$value read-only

private string $value = ''

Methods

__construct()

public __construct([string $value = '' ][, iterable<string|int, mixed> $children = [] ]) : mixed
Parameters
$value : string = ''
$children : iterable<string|int, mixed> = []

__toString()

public __toString() : string
Return values
string

addChild()

public addChild(self|string|callable $node) : self
Parameters
$node : self|string|callable
Return values
self

count()

public count() : int
Return values
int

fromValues()

public static fromValues(iterable<string|int, mixed> $nodes[, self|null $node = null ]) : self
Parameters
$nodes : iterable<string|int, mixed>
$node : self|null = null
Return values
self

getValue()

public getValue() : string
Return values
string

        
On this page

Search results