Documentation

Dump

Built-in dump library

Tags
author

ghostff

link
https://github.com/Ghostff/Dump7
version
1.0.0
since
1.0.0
license

MIT https://mit-license.org

Table of Contents

$isCli  : mixed
$backgrounds  : array<string|int, mixed>
Background colors map
$changes  : mixed
$colors  : mixed
$foregrounds  : array<string|int, mixed>
Foreground colors map
$indent  : mixed
$isPosix  : mixed
$nest_level  : mixed
$pad_size  : mixed
$safe  : mixed
$styles  : array<string|int, mixed>
Styles map
$trace_offset  : mixed
__construct()  : mixed
Dump constructor.
aboveNestLevel()  : bool
Assert code nesting doesn't surpass specified limit.
safe()  : mixed
Force debug to use posix, (For window users who are using tools like http://cmder.net/)
set()  : mixed
Updates color properties value.
setTraceOffset()  : mixed
Set backtrace offset.
write()  : mixed
Writes dump to console.
arrayIndex()  : string
Formats array index.
breakLine()  : string
Move cursor to next line.
color()  : string
Sets string color based on sapi.
evaluate()  : string
Couples all formats.
format()  : string
Format string using ANSI escape sequences
formatArray()  : string
Formats array elements.
formatObject()  : string
Formats object elements.
getValue()  : string
Formats object property values.
indent()  : string
Indents line content.
isPosix()  : bool
Check if a resource is an interactive terminal
output()  : mixed
Outputs formatted dump files.
pad()  : string
Adds padding to the line.
refcount()  : string
Gets the id of an object. (DIRTY)
type()  : string
Formats the data type.

Properties

$isCli

protected mixed $isCli = false

$backgrounds

Background colors map

private array<string|int, mixed> $backgrounds = ['none' => null, 'black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'purple' => 45, 'cyan' => 46, 'light_gray' => 47, 'dark_gray' => 100, 'light_red' => 101, 'light_green' => 102, 'light_yellow' => 103, 'light_blue' => 104, 'light_magenta' => 105, 'light_cyan' => 106, 'white' => 107]

$changes

private static mixed $changes = []

$colors

private mixed $colors = ['string' => ['0000FF', 'blue'], 'integer' => ['1BAABB', 'light_green'], 'double' => ['9C6E25', 'cyan'], 'boolean' => ['bb02ff', 'purple'], 'keyword' => ['bb02ff', 'purple'], 'null' => ['6789f8', 'white'], 'type' => ['AAAAAA', 'dark_gray'], 'size' => ['5BA415', 'green'], 'recursion' => ['F00000', 'red'], 'resource' => ['F00000', 'red'], 'array' => ['000000', 'white'], 'multi_array_key' => ['59829e', 'yellow'], 'single_array_key' => ['f07b06', 'light_yellow'], 'multi_array_arrow' => ['e103c4', 'red'], 'single_array_arrow' => ['f00000', 'red'], 'object' => ['000000', 'white'], 'property_visibility' => ['741515', 'light_red'], 'property_name' => ['987a00', 'light_cyan'], 'property_arrow' => ['f00000', 'red']]

$foregrounds

Foreground colors map

private array<string|int, mixed> $foregrounds = ['none' => null, 'black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'purple' => 35, 'cyan' => 36, 'light_gray' => 37, 'dark_gray' => 90, 'light_red' => 91, 'light_green' => 92, 'light_yellow' => 93, 'light_blue' => 94, 'light_magenta' => 95, 'light_cyan' => 96, 'white' => 97]

$indent

private mixed $indent = 0

$isPosix

private mixed $isPosix = false

$nest_level

private mixed $nest_level = 20

$pad_size

private mixed $pad_size = 3

$safe

private static mixed $safe = false

$styles

Styles map

private array<string|int, mixed> $styles = ['none' => null, 'bold' => 1, 'faint' => 2, 'italic' => 3, 'underline' => 4, 'blink' => 5, 'negative' => 7]

$trace_offset

private static mixed $trace_offset = 1

Methods

__construct()

Dump constructor.

public __construct(mixed ...$args) : mixed
Parameters
$args : mixed
Return values
mixed

aboveNestLevel()

Assert code nesting doesn't surpass specified limit.

public aboveNestLevel() : bool
Return values
bool

safe()

Force debug to use posix, (For window users who are using tools like http://cmder.net/)

public static safe(mixed ...$args) : mixed
Parameters
$args : mixed
Return values
mixed

set()

Updates color properties value.

public static set(string $name, array<string|int, mixed> $value) : mixed
Parameters
$name : string
$value : array<string|int, mixed>
Return values
mixed

setTraceOffset()

Set backtrace offset.

public static setTraceOffset(int $offset) : mixed
Parameters
$offset : int
Return values
mixed

write()

Writes dump to console.

public write( $message) : mixed
Parameters
$message :
Return values
mixed

arrayIndex()

Formats array index.

private arrayIndex( $key[, bool $parent = false ]) : string
Parameters
$key :
$parent : bool = false
Return values
string

breakLine()

Move cursor to next line.

private breakLine() : string
Return values
string

color()

Sets string color based on sapi.

private color( $value, string $name) : string
Parameters
$value :
$name : string
Return values
string

evaluate()

Couples all formats.

private evaluate(array<string|int, mixed> $args[, bool $called = false ][, bool $from_obj = false ]) : string
Parameters
$args : array<string|int, mixed>
$called : bool = false
$from_obj : bool = false
Return values
string

format()

Format string using ANSI escape sequences

private format(string $string[, string $format = null ]) : string
Parameters
$string : string
$format : string = null

defaults to 'none|none|none'

Return values
string

formatArray()

Formats array elements.

private formatArray(array<string|int, mixed> $array, bool $obj_call) : string
Parameters
$array : array<string|int, mixed>
$obj_call : bool
Return values
string

formatObject()

Formats object elements.

private formatObject( $object) : string
Parameters
$object :
Return values
string

getValue()

Formats object property values.

private getValue(ReflectionProperty $property,  $object, string $class_name) : string
Parameters
$property : ReflectionProperty
$object :
$class_name : string
Return values
string

indent()

Indents line content.

private indent(int $pad) : string
Parameters
$pad : int
Return values
string

isPosix()

Check if a resource is an interactive terminal

private isPosix() : bool
Return values
bool

output()

Outputs formatted dump files.

private output(string $data) : mixed
Parameters
$data : string
Return values
mixed

pad()

Adds padding to the line.

private pad(int $size) : string
Parameters
$size : int
Return values
string

refcount()

Gets the id of an object. (DIRTY)

private refcount( $object) : string
Parameters
$object :
Return values
string

type()

Formats the data type.

private type(string $type[, string $before = '' ]) : string
Parameters
$type : string
$before : string = ''
Return values
string

Search results