PHP Class ConsoleKit\TextFormater

Show file Open project: maximebf/consolekit Class Usage Examples

Public Properties

Property Type Description
$defaultIndentWidth integer

Protected Properties

Property Type Description
$bgColor string
$fgColor string
$indent integer
$indentWidth integer
$quote string

Public Methods

Method Description
__construct ( array $options = [] )
apply ( string $text, array $options = [] ) : string Returns the text formated with the specified options
format ( string $text ) Formats $text according to the formater's options
getBgColor ( ) : string
getFgColor ( ) : string
getIndent ( ) : integer
getIndentWidth ( ) : integer
getQuote ( ) : string
setBgColor ( string $color ) : TextFormater
setFgColor ( string $color ) : TextFormater
setIndent ( integer $indent ) : TextFormater
setIndentWidth ( $width ) : TextFormater
setOptions ( array $options ) : TextFormater Available options: - indentWidth - indent - quote - fgcolor - bgcolor
setQuote ( string $quote ) : TextFormater

Method Details

__construct() public method

public __construct ( array $options = [] )
$options array

apply() public static method

Returns the text formated with the specified options
public static apply ( string $text, array $options = [] ) : string
$text string
$options array
return string

format() public method

Formats $text according to the formater's options
public format ( string $text )
$text string

getBgColor() public method

public getBgColor ( ) : string
return string

getFgColor() public method

public getFgColor ( ) : string
return string

getIndent() public method

public getIndent ( ) : integer
return integer

getIndentWidth() public method

public getIndentWidth ( ) : integer
return integer

getQuote() public method

public getQuote ( ) : string
return string

setBgColor() public method

public setBgColor ( string $color ) : TextFormater
$color string
return TextFormater

setFgColor() public method

public setFgColor ( string $color ) : TextFormater
$color string
return TextFormater

setIndent() public method

public setIndent ( integer $indent ) : TextFormater
$indent integer
return TextFormater

setIndentWidth() public method

public setIndentWidth ( $width ) : TextFormater
return TextFormater

setOptions() public method

Available options: - indentWidth - indent - quote - fgcolor - bgcolor
public setOptions ( array $options ) : TextFormater
$options array
return TextFormater

setQuote() public method

public setQuote ( string $quote ) : TextFormater
$quote string
return TextFormater

Property Details

$bgColor protected property

protected string $bgColor
return string

$defaultIndentWidth public static property

public static int $defaultIndentWidth
return integer

$fgColor protected property

protected string $fgColor
return string

$indent protected property

protected int $indent
return integer

$indentWidth protected property

protected int $indentWidth
return integer

$quote protected property

protected string $quote
return string