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

COLORS  = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']
$helperSet  : mixed
$count  : mixed
$started  : mixed
formatMemory()  : mixed
formatTime()  : mixed
getHelperSet()  : HelperSet|null
Gets the helper set associated with this helper.
getName()  : mixed
{@inheritdoc}
length()  : int
Returns the length of a string, using mb_strlen if it is available.
progress()  : string
Adds progress to a formatting session.
removeDecoration()  : mixed
setHelperSet()  : mixed
Sets the helper set associated with this helper.
start()  : string
Starts a debug formatting session.
stop()  : string
Stops a formatting session.
strlen()  : int
Returns the length of a string, using mb_strwidth if it is available.
strlenWithoutDecoration()  : mixed
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 = null

Methods

formatMemory()

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

formatTime()

public static formatTime(mixed $secs) : mixed
Parameters
$secs : mixed
Return values
mixed

getHelperSet()

Gets the helper set associated with this helper.

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

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 ]) : mixed
Parameters
$helperSet : HelperSet|null = null
Return values
mixed

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

strlen()

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

public static strlen(string|null $string) : int
Parameters
$string : string|null
Tags
deprecated

since Symfony 5.3

Return values
int

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

Search results