TreeRenderer
final readonly class \
Renders normalized data as an indented tree.
Without a fixed depth the first level is always complete and the tree fits into a budget of lines below it: branches are expanded breadth first while their whole next level fits, the rest is shown inline (complete JSON on one line) or as a truncated preview. If previews remain, small flat branches are folded inline to make room for them.
Internal
Table of Contents
Constants
- BUDGET : int = 200
Methods
- __construct() : mixed
- render() : array<int, StyledText>
Constants
BUDGET
public
int
BUDGET
= 200
Methods
__construct()
public
__construct(ValueFormatter $formatter) : mixed
Parameters
- $formatter : ValueFormatter
render()
public
render(mixed $data, int $width, int|null $depth) : array<int, StyledText>
Parameters
- $data : mixed
- $width : int
- $depth : int|null
-
null for the adaptive budget, 0 for everything