class HtmlDumper extends CliDumper

HtmlDumper dumps variables as HTML.

Properties

static $defaultOutput
protected $line from AbstractDumper
protected $lineDumper from AbstractDumper
protected $outputStream from AbstractDumper
protected $decimalPoint from AbstractDumper
protected $indentPad from AbstractDumper
static $defaultColors from CliDumper
protected $colors
protected $maxStringWidth from CliDumper
protected $styles
static protected $controlCharsRx from CliDumper
static protected $controlCharsMap from CliDumper
protected $dumpHeader
protected $dumpPrefix
protected $dumpSuffix
protected $dumpId
protected $headerIsDumped
protected $lastDepth

Methods

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

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|null $output = null)

Dumps a Data object.

dumpLine(int $depth, $endOfValue = false)

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.

setColors(bool $colors)

Enables/disables colored output.

from CliDumper
setMaxStringWidth(int $maxStringWidth)

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

from CliDumper
setStyles(array $styles)

Configures styles.

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

Dumps a scalar value.

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

Dumps a string.

from CliDumper
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.

dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut)

Dumps an ellipsis for cut children.

from CliDumper
dumpKey(Cursor $cursor)

Dumps a key in a hash structure.

from CliDumper
string
style(string $style, string $value, array $attr = array())

Decorates a value with some style.

bool
supportsColors()

No description

from CliDumper
setDumpHeader(string $header)

Sets an HTML header that will be dumped once in the output stream.

setDumpBoundaries(string $prefix, string $suffix)

Sets an HTML prefix and suffix that will encapse every single dump.

getDumpHeader()

Dumps the HTML header.

Details

at line 51
__construct(callable|resource|string|null $output = null, string $charset = null)

Parameters

callable|resource|string|null $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

in AbstractDumper at line 56
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

in AbstractDumper at line 81
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

in AbstractDumper at line 100
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 91
dump(Data $data, callable|resource|string|null $output = null)

Dumps a Data object.

Parameters

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

at line 425
protected dumpLine(int $depth, $endOfValue = false)

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

in AbstractDumper at line 158
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

in AbstractDumper at line 172
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

in CliDumper at line 82
setColors(bool $colors)

Enables/disables colored output.

Parameters

bool $colors

in CliDumper at line 92
setMaxStringWidth(int $maxStringWidth)

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

Parameters

int $maxStringWidth

at line 60
setStyles(array $styles)

Configures styles.

Parameters

array $styles A map of style names to style definitions

in CliDumper at line 110
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

in CliDumper at line 160
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

at line 333
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

at line 353
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

in CliDumper at line 287
protected dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut)

Dumps an ellipsis for cut children.

Parameters

Cursor $cursor The Cursor position in the dump
bool $hasChild When the dump of the hash has child item
int $cut The number of items the hash has been cut by

in CliDumper at line 305
protected dumpKey(Cursor $cursor)

Dumps a key in a hash structure.

Parameters

Cursor $cursor The Cursor position in the dump

at line 365
protected string style(string $style, string $value, array $attr = array())

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

Return Value

string The value with style decoration

in CliDumper at line 418
protected bool supportsColors()

Return Value

bool Tells if the current output stream supports ANSI colors or not

at line 71
setDumpHeader(string $header)

Sets an HTML header that will be dumped once in the output stream.

Parameters

string $header An HTML string

at line 82
setDumpBoundaries(string $prefix, string $suffix)

Sets an HTML prefix and suffix that will encapse every single dump.

Parameters

string $prefix The prepended HTML string
string $suffix The appended HTML string

at line 100
protected getDumpHeader()

Dumps the HTML header.