abstract class AbstractDumper implements DataDumperInterface, DumperInterface

Abstract mechanism for dumping a Data object.

Constants

DUMP_LIGHT_ARRAY

DUMP_STRING_LENGTH

DUMP_COMMA_SEPARATOR

DUMP_TRAILING_COMMA

Properties

static $defaultOutput
protected $line
protected $lineDumper
protected $outputStream
protected $decimalPoint
protected $indentPad
protected $flags

Methods

__construct(callable|resource|string|null $output = null, string|null $charset = null, int $flags = 0)

No description

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

Sets the output destination of the dumps.

string
setCharset(string $charset)

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

string
setIndentPad(string $pad)

Sets the indentation pad string.

dump(Data $data, callable|resource|string|true|null $output = null)

Dumps a Data object.

dumpLine(int $depth)

Dumps the current line.

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

Generic line dumper callback.

string
utf8Encode(string $s)

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

Details

at line 45
__construct(callable|resource|string|null $output = null, string|null $charset = null, int $flags = 0)

Parameters

callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput
string|null $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

at line 64
callable|resource|string setOutput(callable|resource|string $output)

Sets the output destination of the dumps.

Parameters

callable|resource|string $output A line dumper callable, an opened stream or an output path

Return Value

callable|resource|string The previous output destination

at line 89
string setCharset(string $charset)

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

Parameters

string $charset The default character encoding to use for non-UTF8 strings

Return Value

string The previous charset

at line 108
string setIndentPad(string $pad)

Sets the indentation pad string.

Parameters

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

Return Value

string The previous indent pad

at line 124
dump(Data $data, callable|resource|string|true|null $output = null)

Dumps a Data object.

Parameters

Data $data
callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump

at line 165
protected dumpLine(int $depth)

Dumps the current line.

Parameters

int $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

at line 178
protected echoLine(string $line, int $depth, string $indentPad)

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

at line 192
protected string utf8Encode(string $s)

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

Parameters

string $s The non-UTF-8 string to convert

Return Value

string The string converted to UTF-8