class Doctrine_Cli_Formatter (View source)

Doctrine_Cli_Formatter provides methods to format text to be displayed on a console.

This class was taken from the symfony-project source

Properties

protected $_size

Methods

void
__construct(string $maxLineSize = 65)

__construct

string
format(string $text = '', mixed $parameters = array(), stream $stream = STDOUT)

Formats a text according to the given parameters.

formatSection(string $section, string $text, integer $size = null)

Formats a message within a section.

string
excerpt(string $text, integer $size = null)

Truncates a line.

setMaxLineSize(integer $size)

Sets the maximum line size.

Details

void __construct(string $maxLineSize = 65)

__construct

Parameters

string $maxLineSize

Return Value

void

string format(string $text = '', mixed $parameters = array(), stream $stream = STDOUT)

Formats a text according to the given parameters.

Parameters

string $text The test to style
mixed $parameters An array of parameters
stream $stream A stream (default to STDOUT)

Return Value

string The formatted text

formatSection(string $section, string $text, integer $size = null)

Formats a message within a section.

Parameters

string $section The section name
string $text The text message
integer $size The maximum size allowed for a line (65 by default)

string excerpt(string $text, integer $size = null)

Truncates a line.

Parameters

string $text The text
integer $size The maximum size of the returned string (65 by default)

Return Value

string The truncated string

setMaxLineSize(integer $size)

Sets the maximum line size.

Parameters

integer $size The maximum line size for a message