class DumperCollection implements IteratorAggregate

Collection of routes.

Methods

all()

Returns the children routes and collections.

add(DumperRoute|DumperCollection $child)

Adds a route or collection.

setAll(array $children)

Sets children.

getIterator()

Returns an iterator over the children.

getRoot()

Returns the root of the collection.

getParent()

Returns the parent collection.

setParent(DumperCollection $parent)

Sets the parent collection.

bool
hasAttribute(string $name)

Returns true if the attribute is defined.

mixed
getAttribute(string $name, mixed $default = null)

Returns an attribute by name.

setAttribute(string $name, mixed $value)

Sets an attribute by name.

setAttributes(array $attributes)

Sets multiple attributes.

Details

at line 43
DumperCollection[]|DumperRoute[] all()

Returns the children routes and collections.

Return Value

DumperCollection[]|DumperRoute[]

at line 53
add(DumperRoute|DumperCollection $child)

Adds a route or collection.

Parameters

DumperRoute|DumperCollection $child The route or collection

at line 66
setAll(array $children)

Sets children.

Parameters

array $children The children

at line 81
Iterator|DumperCollection[]|DumperRoute[] getIterator()

Returns an iterator over the children.

Return Value

Iterator|DumperCollection[]|DumperRoute[] The iterator

at line 91
DumperCollection getRoot()

Returns the root of the collection.

Return Value

DumperCollection The root collection

at line 101
protected DumperCollection|null getParent()

Returns the parent collection.

Return Value

DumperCollection|null The parent collection or null if the collection has no parent

at line 109
protected setParent(DumperCollection $parent)

Sets the parent collection.

Parameters

DumperCollection $parent

at line 121
bool hasAttribute(string $name)

Returns true if the attribute is defined.

Parameters

string $name The attribute name

Return Value

bool true if the attribute is defined, false otherwise

at line 134
mixed getAttribute(string $name, mixed $default = null)

Returns an attribute by name.

Parameters

string $name The attribute name
mixed $default Default value is the attribute doesn't exist

Return Value

mixed The attribute value

at line 145
setAttribute(string $name, mixed $value)

Sets an attribute by name.

Parameters

string $name The attribute name
mixed $value The attribute value

at line 155
setAttributes(array $attributes)

Sets multiple attributes.

Parameters

array $attributes The attributes