W3cubDocs

/Symfony 2.7

Symfony\Component\VarDumper\Dumper\CliDumper

class CliDumper extends AbstractDumper

CliDumper dumps variables for command line output.

Properties

static $defaultOutput
static $defaultColors

Methods

__construct(callable|resource|string|null $output = null)
callable|resource|string setOutput(callable|resource|string $output)

Sets the output destination of the dumps.

from AbstractDumper
string setIndentPad(string $pad)

Sets the indentation pad string.

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

Dumps a Data object.

from AbstractDumper
setColors(bool $colors)

Enables/disables colored output.

setMaxStringWidth(int $maxStringWidth)

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

setStyles(array $styles)

Configures styles.

dumpScalar(Cursor $cursor, string $type, scalar $value)

Dumps a scalar value.

dumpString(Cursor $cursor, string $str, bool $bin, int $cut)

Dumps a string.

enterHash(Cursor $cursor, int $type, string $class, bool $hasChild)

Dumps while entering an hash.

leaveHash(Cursor $cursor, int $type, string $class, bool $hasChild, int $cut)

Dumps while leaving an hash.

Details

public __construct(callable|resource|string|null $output = null)

Parameters

callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput.

public 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.

public string setIndentPad(string $pad)

Sets the indentation pad string.

Parameters

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

Return Value

string The indent pad.

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

Dumps a Data object.

Parameters

Data $data A Data object.
callable|resource|string|null $output A line dumper callable, an opened stream or an output path.

public setColors(bool $colors)

Enables/disables colored output.

Parameters

bool $colors

public setMaxStringWidth(int $maxStringWidth)

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

Parameters

int $maxStringWidth

public setStyles(array $styles)

Configures styles.

Parameters

array $styles A map of style names to style definitions.

public dumpScalar(Cursor $cursor, string $type, scalar $value)

Dumps a scalar value.

Parameters

Cursor $cursor The Cursor position in the dump.
string $type The PHP type of the value being dumped.
scalar $value The scalar value being dumped.

public dumpString(Cursor $cursor, string $str, bool $bin, int $cut)

Dumps a string.

Parameters

Cursor $cursor The Cursor position in the dump.
string $str The string being dumped.
bool $bin Whether $str is UTF-8 or binary encoded.
int $cut The number of characters $str has been cut by.

public enterHash(Cursor $cursor, int $type, string $class, bool $hasChild)

Dumps while entering an hash.

Parameters

Cursor $cursor The Cursor position in the dump.
int $type A Cursor::HASH_* const for the type of hash.
string $class The object class, resource type or array count.
bool $hasChild When the dump of the hash has child item.

public leaveHash(Cursor $cursor, int $type, string $class, bool $hasChild, int $cut)

Dumps while leaving an hash.

Parameters

Cursor $cursor The Cursor position in the dump.
int $type A Cursor::HASH_* const for the type of hash.
string $class The object class, resource type or array count.
bool $hasChild When the dump of the hash has child item.
int $cut The number of items the hash has been cut by.

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/VarDumper/Dumper/CliDumper.html