class CliDumper extends CliDumper

Traits

Resolve dump sources for consumers that provide $basePath and $compiledViewPath properties.

Resolve source links for consumers that provide a $basePath property.

Constants

protected DUMPING_CONTEXT_KEY

Properties

protected array<string, string> $editorHrefs

All of the href formats for common editors.

from  ResolvesSourceHref
static protected array<string, int> $adjustableTraces

Files that require special trace handling and their levels.

from  ResolvesDumpSource
static protected null|callable(): null|array{0: string, 1: string, 2: null|int}|false $dumpSourceResolver

The source resolver.

from  ResolvesDumpSource
protected OutputInterface $output

The console output instance.

Methods

string|null
resolveSourceHref(string $file, int|null $line)

Resolve the source href, if possible.

array|null
resolveDumpSource()

Resolve the source of the dump call.

bool
isCompiledViewFile(string $file)

Determine if the given file is a view compiled.

string
getOriginalFileForCompiledView(string $file)

Get the original view compiled file by the given compiled file.

static void
resolveDumpSourceUsing(callable|null $callable)

Set the resolver that resolves the source of the dump call.

static void
dontIncludeSource()

Don't include the location / file of the dump in dumps.

static void
flushState()

Flush all static state.

__construct(OutputInterface $output, string $basePath, string $compiledViewPath)

Create a new CLI dumper instance.

static void
register(string $basePath, string $compiledViewPath)

Create a new CLI dumper instance and register it as the default dumper.

void
dumpWithSource(Data $data)

Dump a variable with its source file / line.

string
getDumpSourceContent()

Get the dump's source console content.

bool
supportsColors()

Determine if the output supports colors.

Details

in ResolvesSourceHref at line 50
protected string|null resolveSourceHref(string $file, int|null $line)

Resolve the source href, if possible.

Parameters

string $file
int|null $line

Return Value

string|null

in ResolvesDumpSource at line 36
array|null resolveDumpSource()

Resolve the source of the dump call.

Return Value

array|null

in ResolvesDumpSource at line 98
protected bool isCompiledViewFile(string $file)

Determine if the given file is a view compiled.

Parameters

string $file

Return Value

bool

in ResolvesDumpSource at line 110
protected string getOriginalFileForCompiledView(string $file)

Get the original view compiled file by the given compiled file.

Parameters

string $file

Return Value

string

in ResolvesDumpSource at line 135
static void resolveDumpSourceUsing(callable|null $callable)

Set the resolver that resolves the source of the dump call.

Boot-only. The resolver persists in a static property for the worker lifetime and runs on every dump source resolution across all coroutines.

Parameters

callable|null $callable

Return Value

void

in ResolvesDumpSource at line 146
static void dontIncludeSource()

Don't include the location / file of the dump in dumps.

Boot-only. The flag persists in a static property for the worker lifetime and applies to every dump source resolution across all coroutines.

Return Value

void

in ResolvesDumpSource at line 154
static void flushState()

Flush all static state.

Return Value

void

at line 35
__construct(OutputInterface $output, string $basePath, string $compiledViewPath)

Create a new CLI dumper instance.

Parameters

OutputInterface $output
string $basePath
string $compiledViewPath

at line 53
static void register(string $basePath, string $compiledViewPath)

Create a new CLI dumper instance and register it as the default dumper.

Boot-only. Registers a process-wide VarDumper handler for the worker lifetime.

Parameters

string $basePath
string $compiledViewPath

Return Value

void

at line 65
void dumpWithSource(Data $data)

Dump a variable with its source file / line.

Parameters

Data $data

Return Value

void

at line 90
protected string getDumpSourceContent()

Get the dump's source console content.

Return Value

string

at line 111
protected bool supportsColors()

Determine if the output supports colors.

Return Value

bool