Constants

DUMP_LIGHT_ARRAY

DUMP_LIGHT_ARRAY = 1

DUMP_STRING_LENGTH

DUMP_STRING_LENGTH = 2

DUMP_COMMA_SEPARATOR

DUMP_COMMA_SEPARATOR = 4

DUMP_TRAILING_COMMA

DUMP_TRAILING_COMMA = 8

Properties

$defaultOutput

$defaultOutput

$defaultColors

$defaultColors

$line

$line

$lineDumper

$lineDumper

$outputStream

$outputStream

$decimalPoint

$decimalPoint

$indentPad

$indentPad

$flags

$flags

$colors

$colors

$maxStringWidth

$maxStringWidth

$styles

$styles

$controlCharsRx

$controlCharsRx

$controlCharsMap

$controlCharsMap

$collapseNextHash

$collapseNextHash

$expandNextHash

$expandNextHash

$charset

$charset

$displayOptions

$displayOptions

$handlesHrefGracefully

$handlesHrefGracefully

Methods

__construct()

__construct(mixed  $output = null, string  $charset = null, int  $flags) : mixed

Parameters

mixed $output

A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput

string $charset

The default character encoding to use for non-UTF8 strings

int $flags

A bit field of static::DUMP_* constants to fine tune dumps representation

Returns

mixed —

setOutput()

setOutput(callable|resource|string  $output) : callable|resource|string

Sets the output destination of the dumps.

Parameters

callable|resource|string $output

A line dumper callable, an opened stream or an output path

Returns

callable|resource|string —

The previous output destination

setCharset()

setCharset(string  $charset) : string

Sets the default character encoding to use for non-UTF8 strings.

Parameters

string $charset

The default character encoding to use for non-UTF8 strings

Returns

string —

The previous charset

setIndentPad()

setIndentPad(string  $pad) : string

Sets the indentation pad string.

Parameters

string $pad

A string that will be prepended to dumped lines, repeated by nesting level

Returns

string —

The previous indent pad

dump()

dump(\Symfony\Component\VarDumper\Cloner\Data  $data, callable|resource|string|true|null  $output = null) : string|null

Dumps a Data object.

Parameters

\Symfony\Component\VarDumper\Cloner\Data $data
callable|resource|string|true|null $output

A line dumper callable, an opened stream, an output path or true to return the dump

Returns

string|null —

The dump as string when $output is true

setColors()

setColors(bool  $colors) : mixed

Enables/disables colored output.

Parameters

bool $colors

Returns

mixed —

setMaxStringWidth()

setMaxStringWidth(int  $maxStringWidth) : mixed

Sets the maximum number of characters per line for dumped strings.

Parameters

int $maxStringWidth

Returns

mixed —

setStyles()

setStyles(array  $styles) : mixed

Configures styles.

Parameters

array $styles

A map of style names to style definitions

Returns

mixed —

setDisplayOptions()

setDisplayOptions(array  $displayOptions) : mixed

Configures display options.

Parameters

array $displayOptions

A map of display options to customize the behavior

Returns

mixed —

dumpScalar()

dumpScalar(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor, mixed  $type, mixed  $value) : mixed

{@inheritdoc}

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor
mixed $type
mixed $value

Returns

mixed —

dumpString()

dumpString(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor, mixed  $str, mixed  $bin, mixed  $cut) : mixed

{@inheritdoc}

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor
mixed $str
mixed $bin
mixed $cut

Returns

mixed —

enterHash()

enterHash(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor, mixed  $type, mixed  $class, mixed  $hasChild) : mixed

{@inheritdoc}

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor
mixed $type
mixed $class
mixed $hasChild

Returns

mixed —

leaveHash()

leaveHash(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor, mixed  $type, mixed  $class, mixed  $hasChild, mixed  $cut) : mixed

{@inheritdoc}

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor
mixed $type
mixed $class
mixed $hasChild
mixed $cut

Returns

mixed —

dumpLine()

dumpLine(mixed  $depth, mixed  $endOfValue = false) : mixed

Dumps the current line.

Parameters

mixed $depth

The recursive depth in the dumped structure for the line being dumped, or -1 to signal the end-of-dump to the line dumper callable

mixed $endOfValue

Returns

mixed —

echoLine()

echoLine(string  $line, int  $depth, string  $indentPad) : mixed

Generic line dumper callback.

Parameters

string $line

The line to write

int $depth

The recursive depth in the dumped structure

string $indentPad

The line indent pad

Returns

mixed —

utf8Encode()

utf8Encode(string|null  $s) : string|null

Converts a non-UTF-8 string to UTF-8.

Parameters

string|null $s

The non-UTF-8 string to convert

Returns

string|null —

The string converted to UTF-8

dumpEllipsis()

dumpEllipsis(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor, bool  $hasChild, int  $cut) : mixed

Dumps an ellipsis for cut children.

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor
bool $hasChild

When the dump of the hash has child item

int $cut

The number of items the hash has been cut by

Returns

mixed —

dumpKey()

dumpKey(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor) : mixed

Dumps a key in a hash structure.

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor

Returns

mixed —

style()

style(string  $style, string  $value, array  $attr = []) : string

Decorates a value with some style.

Parameters

string $style

The type of style being applied

string $value

The value being styled

array $attr

Optional context information

Returns

string —

The value with style decoration

supportsColors()

supportsColors() : bool

Returns

bool —

Tells if the current output stream supports ANSI colors or not

endValue()

endValue(\Symfony\Component\VarDumper\Cloner\Cursor  $cursor) : mixed

Parameters

\Symfony\Component\VarDumper\Cloner\Cursor $cursor

Returns

mixed —

hasColorSupport()

hasColorSupport(mixed  $stream) : bool

Returns true if the stream supports colorization.

Reference: Composer\XdebugHandler\Process::supportsColor https://github.com/composer/xdebug-handler

Parameters

mixed $stream

A CLI output stream

Returns

bool —

isWindowsTrueColor()

isWindowsTrueColor() : bool

Returns true if the Windows terminal supports true color.

Note that this does not check an output stream, but relies on environment variables from known implementations, or a PHP and Windows version that supports true color.

Returns

bool —

getSourceLink()

getSourceLink(string  $file, int  $line) : mixed

Parameters

string $file
int $line

Returns

mixed —