DumpNode
API reference › Debug Core › Panel › Log › DumpNode
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.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$entries readonly constructor | list<DumpEntry> | Block entries. | DumpNode |
$kind readonly constructor | DumpKind | Kind of value represented by the node. | DumpNode |
$label readonly constructor | string | Class name of an object, enum, or recursive object; '' otherwise. | DumpNode |
$text readonly constructor | string | Scalar text, enum case name, or free text preceding a root block header. | DumpNode |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
block() static | Creates an array, object, or enum block. | DumpNode |
boolean() static | Creates a boolean from its printed text. | DumpNode |
enumCase() static | Creates the enum case reference that var_export() prints as \. | DumpNode |
float() static | Creates a float from its printed text. | DumpNode |
fromValue() static | Creates the tree of a context value normalized by LogContext::normalize(). | DumpNode |
integer() static | Creates an integer from its printed text. | DumpNode |
null() static | Creates a null from its printed text. | DumpNode |
recursion() static | Creates the marker print_r() prints instead of an array or object it is already printing. | DumpNode |
scalar() static | Creates an untyped print_r() scalar. | DumpNode |
string() static | Creates a string from its decoded value. | DumpNode |
Method details
Section titled “Method details”block()
Section titled “block() ”public static function block(PHPForge\Debug\Panel\Log\DumpKind $kind, string $label, list<PHPForge\Debug\Panel\Log\DumpEntry> $entries, string $prefix = ''): selfCreates an array, object, or enum block.
boolean()
Section titled “boolean() ”public static function boolean(string $text): selfCreates a boolean from its printed text.
Parameters
| Parameter | Type | Description |
|---|---|---|
$text | string |
Returns
self
enumCase()
Section titled “enumCase() ”public static function enumCase(string $class, string $case): selfCreates the enum case reference that var_export() prints as \Class::Case.
Parameters
| Parameter | Type | Description |
|---|---|---|
$class | string | Enum class name, without the leading backslash. |
$case | string |
Returns
self
float()
Section titled “float() ”public static function float(string $text): selfCreates a float from its printed text.
Parameters
| Parameter | Type | Description |
|---|---|---|
$text | string |
Returns
self
fromValue()
Section titled “fromValue() ”public static function fromValue(mixed $value): self|nullCreates 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
| Parameter | Type | Description |
|---|---|---|
$value | mixed |
Returns
self|null: Tree, or null over the PrintRParser depth or value bound.
integer()
Section titled “integer() ”public static function integer(string $text): selfCreates an integer from its printed text.
Parameters
| Parameter | Type | Description |
|---|---|---|
$text | string |
Returns
self
null()
Section titled “null() ”public static function null(string $text): selfCreates a null from its printed text.
Parameters
| Parameter | Type | Description |
|---|---|---|
$text | string |
Returns
self
recursion()
Section titled “recursion() ”public static function recursion(string $label): selfCreates the marker print_r() prints instead of an array or object it is already printing.
Parameters
| Parameter | Type | Description |
|---|---|---|
$label | string | Class name of a recursive object; '' for a recursive array. |
Returns
self
scalar()
Section titled “scalar() ”public static function scalar(string $text): selfCreates an untyped print_r() scalar.
Parameters
| Parameter | Type | Description |
|---|---|---|
$text | string | Text as printed, continuation lines included. |
Returns
self
string()
Section titled “string() ”public static function string(string $value): selfCreates a string from its decoded value.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string |
Returns
self