Documentation

DebugFormatterHelper extends Helper
in package

Helps outputting debug information when running an external program from a command.

An external program can be a Process, an HTTP request, or anything else.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

Constants

COLORS  = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']

Properties

$helperSet  : mixed
$count  : int
$started  : array<string|int, mixed>

Methods

formatMemory()  : string
formatTime()  : string
getHelperSet()  : HelperSet|null
Gets the helper set associated with this helper.
getName()  : string
Returns the canonical name of this helper.
length()  : int
Returns the length of a string, using mb_strlen if it is available.
progress()  : string
Adds progress to a formatting session.
removeDecoration()  : string
setHelperSet()  : void
Sets the helper set associated with this helper.
start()  : string
Starts a debug formatting session.
stop()  : string
Stops a formatting session.
substr()  : string
Returns the subset of a string, using mb_substr if it is available.
width()  : int
Returns the width of a string, using mb_strwidth if it is available.
getBorder()  : string

Constants

COLORS

private mixed COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']

Properties

$helperSet

protected mixed $helperSet

Methods

formatMemory()

public static formatMemory(int $memory) : string
Parameters
$memory : int
Return values
string

formatTime()

public static formatTime(int|float $secs[, int $precision = 1 ]) : string
Parameters
$secs : int|float
$precision : int = 1
Return values
string

getHelperSet()

Gets the helper set associated with this helper.

public getHelperSet() : HelperSet|null
Return values
HelperSet|null

getName()

Returns the canonical name of this helper.

public getName() : string
Return values
string

length()

Returns the length of a string, using mb_strlen if it is available.

public static length(string|null $string) : int

The length is related to how many bytes the string will use.

Parameters
$string : string|null
Return values
int

progress()

Adds progress to a formatting session.

public progress(string $id, string $buffer[, bool $error = false ][, string $prefix = 'OUT' ][, string $errorPrefix = 'ERR' ]) : string
Parameters
$id : string
$buffer : string
$error : bool = false
$prefix : string = 'OUT'
$errorPrefix : string = 'ERR'
Return values
string

setHelperSet()

Sets the helper set associated with this helper.

public setHelperSet([HelperSet|null $helperSet = null ]) : void
Parameters
$helperSet : HelperSet|null = null

start()

Starts a debug formatting session.

public start(string $id, string $message[, string $prefix = 'RUN' ]) : string
Parameters
$id : string
$message : string
$prefix : string = 'RUN'
Return values
string

stop()

Stops a formatting session.

public stop(string $id, string $message, bool $successful[, string $prefix = 'RES' ]) : string
Parameters
$id : string
$message : string
$successful : bool
$prefix : string = 'RES'
Return values
string

substr()

Returns the subset of a string, using mb_substr if it is available.

public static substr(string|null $string, int $from[, int|null $length = null ]) : string
Parameters
$string : string|null
$from : int
$length : int|null = null
Return values
string

width()

Returns the width of a string, using mb_strwidth if it is available.

public static width(string|null $string) : int

The width is how many characters positions the string will use.

Parameters
$string : string|null
Return values
int

getBorder()

private getBorder(string $id) : string
Parameters
$id : string
Return values
string

        
On this page

Search results