\Symfony\Component\Console\HelperFormatterHelper

The Formatter class provides helpers to format messages.

Summary

Methods
Properties
Constants
setHelperSet()
getHelperSet()
strlen()
substr()
formatTime()
formatMemory()
strlenWithoutDecoration()
removeDecoration()
formatSection()
formatBlock()
truncate()
getName()
No public properties found
No constants found
No protected methods found
$helperSet
N/A
No private methods found
No private properties found
N/A

Properties

$helperSet

$helperSet : 

Type

Methods

strlen()

strlen(string  $string) : integer

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

Parameters

string $string

The string to check its length

Returns

integer —

The length of the string

substr()

substr(string  $string, integer  $from, integer|null  $length = null) : string

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

Parameters

string $string

String to subset

integer $from

Start offset

integer|null $length

Length to read

Returns

string —

The string subset

formatTime()

formatTime(  $secs) 

Parameters

$secs

formatMemory()

formatMemory(  $memory) 

Parameters

$memory

formatSection()

formatSection(string  $section, string  $message, string  $style = 'info') : string

Formats a message within a section.

Parameters

string $section

The section name

string $message

The message

string $style

The style to apply to the section

Returns

string —

The format section

formatBlock()

formatBlock(string|array  $messages, string  $style, boolean  $large = false) : string

Formats a message as a block of text.

Parameters

string|array $messages

The message to write in the block

string $style

The style to apply to the whole block

boolean $large

Whether to return a large block

Returns

string —

The formatter message

truncate()

truncate(string  $message, integer  $length, string  $suffix = '...') : string

Truncates a message to the given length.

Parameters

string $message
integer $length
string $suffix

Returns

string

getName()

getName() 

{@inheritdoc}