Skip to content
PHP Ecosystem
Explore

DumpNode

API reference › Debug Core › Panel › Log › DumpNode

final readonly classPHPForge\Debug\Panel\Log\DumpNode
Sourcesrc/Panel/Log/DumpNode.php

Represents one value of a dump tree: a scalar, an enum case reference, a recursion marker, or a block with entries.

PrintRParser and PhpExportParser build trees from log messages; DumpTreeRenderer renders them.

PropertyTypeDescriptionDefined by
$entries readonly constructorlist<DumpEntry>Block entries.DumpNode
$kind readonly constructorDumpKindKind of value represented by the node.DumpNode
$label readonly constructorstringClass name of an object, enum, or recursive object; '' otherwise.DumpNode
$text readonly constructorstringScalar text, enum case name, or free text preceding a root block header.DumpNode
MethodDescriptionDefined by
block() staticCreates an array, object, or enum block.DumpNode
boolean() staticCreates a boolean from its printed text.DumpNode
enumCase() staticCreates the enum case reference that var_export() prints as \Class::Case.DumpNode
float() staticCreates a float from its printed text.DumpNode
fromValue() staticCreates the tree of a context value normalized by LogContext::normalize().DumpNode
integer() staticCreates an integer from its printed text.DumpNode
null() staticCreates a null from its printed text.DumpNode
recursion() staticCreates the marker print_r() prints instead of an array or object it is already printing.DumpNode
scalar() staticCreates an untyped print_r() scalar.DumpNode
string() staticCreates a string from its decoded value.DumpNode
public static function block(PHPForge\Debug\Panel\Log\DumpKind $kind, string $label, list<PHPForge\Debug\Panel\Log\DumpEntry> $entries, string $prefix = ''): self

Creates an array, object, or enum block.

Parameters

ParameterTypeDescription
$kindDumpKind
$labelstringClass name of an object or enum; '' for an array.
$entrieslist<DumpEntry>Entries in dump order.
$prefixstringFree text preceding a root block header, such as Request:.

Returns

self

public static function boolean(string $text): self

Creates a boolean from its printed text.

Parameters

ParameterTypeDescription
$textstring

Returns

self

public static function enumCase(string $class, string $case): self

Creates the enum case reference that var_export() prints as \Class::Case.

Parameters

ParameterTypeDescription
$classstringEnum class name, without the leading backslash.
$casestring

Returns

self

public static function float(string $text): self

Creates a float from its printed text.

Parameters

ParameterTypeDescription
$textstring

Returns

self

public static function fromValue(mixed $value): self|null

Creates the tree of a context value normalized by LogContext::normalize().

A value that is neither an array, a scalar, nor null becomes an untyped scalar.

Parameters

ParameterTypeDescription
$valuemixed

Returns

self|null: Tree, or null over the PrintRParser depth or value bound.

public static function integer(string $text): self

Creates an integer from its printed text.

Parameters

ParameterTypeDescription
$textstring

Returns

self

public static function null(string $text): self

Creates a null from its printed text.

Parameters

ParameterTypeDescription
$textstring

Returns

self

public static function recursion(string $label): self

Creates the marker print_r() prints instead of an array or object it is already printing.

Parameters

ParameterTypeDescription
$labelstringClass name of a recursive object; '' for a recursive array.

Returns

self

public static function scalar(string $text): self

Creates an untyped print_r() scalar.

Parameters

ParameterTypeDescription
$textstringText as printed, continuation lines included.

Returns

self

public static function string(string $value): self

Creates a string from its decoded value.

Parameters

ParameterTypeDescription
$valuestring

Returns

self