interface IOInterface implements IOInterface (View source)

The IOInterface class.

Methods

out(string $text = '')

Write a string to standard output

string
in()

Get a value from standard input.

err(string $text = '')

Write a string to standard error output.

mixed
getOption(string $name, mixed $default = null)

Gets a value from the input data.

void
setOption(string $name, mixed $value)

Sets a value

string[]
getOptions()

getOptions

mixed
getArgument(integer $offset, mixed $default = null)

getArgument

setArgument(integer $offset, mixed $value)

setArgument

string[]
getArguments()

getArguments

mixed
getCalledScript()

getExecuted

string
shiftArgument()

shiftArgument

unshiftArgument(string $arg)

unshiftArgument

string
popArgument()

popArgument

pushArgument(string $arg)

pushArgument

setArguments(array $args)

set Arguments

addColor(string $name, string $fg, string $bg, array $options = array())

addColor

useColor(boolean $bool = true)

useColor

void
__clone()

__clone

setOutputStream(resource $outStream)

setOutStream

setErrorStream(resource $errorStream)

Method to set property errorStream

setInputStream(resource $inputStream)

setInputStream

Details

in IOInterface at line line 25
IOInterface out(string $text = '')

Write a string to standard output

Parameters

string $text The text to display.

Return Value

IOInterface Instance of $this to allow chaining.

in IOInterface at line line 32
string in()

Get a value from standard input.

Return Value

string The input string from standard input.

in IOInterface at line line 41
IOInterface err(string $text = '')

Write a string to standard error output.

Parameters

string $text The text to display.

Return Value

IOInterface

in IOInterface at line line 53
mixed getOption(string $name, mixed $default = null)

Gets a value from the input data.

Parameters

string $name Name of the value to get.
mixed $default Default value to return if variable does not exist.

Return Value

mixed The filtered input value.

in IOInterface at line line 65
void setOption(string $name, mixed $value)

Sets a value

Parameters

string $name Name of the value to set.
mixed $value Value to assign to the input.

Return Value

void

in IOInterface at line line 72
string[] getOptions()

getOptions

Return Value

string[]

in IOInterface at line line 82
mixed getArgument(integer $offset, mixed $default = null)

getArgument

Parameters

integer $offset
mixed $default

Return Value

mixed

in IOInterface at line line 92
IOInterface setArgument(integer $offset, mixed $value)

setArgument

Parameters

integer $offset
mixed $value

Return Value

IOInterface

in IOInterface at line line 99
string[] getArguments()

getArguments

Return Value

string[]

mixed getCalledScript()

getExecuted

Return Value

mixed

at line line 25
string shiftArgument()

shiftArgument

Return Value

string

at line line 34
IOInterface unshiftArgument(string $arg)

unshiftArgument

Parameters

string $arg

Return Value

IOInterface

at line line 41
string popArgument()

popArgument

Return Value

string

at line line 50
IOInterface pushArgument(string $arg)

pushArgument

Parameters

string $arg

Return Value

IOInterface

at line line 59
IOInterface setArguments(array $args)

set Arguments

Parameters

array $args

Return Value

IOInterface

at line line 71
IOInterface addColor(string $name, string $fg, string $bg, array $options = array())

addColor

Parameters

string $name The color name.
string $fg Foreground color.
string $bg Background color.
array $options Style options.

Return Value

IOInterface

at line line 80
IOInterface useColor(boolean $bool = true)

useColor

Parameters

boolean $bool

Return Value

IOInterface

at line line 87
void __clone()

__clone

Return Value

void

at line line 96
IOInterface setOutputStream(resource $outStream)

setOutStream

Parameters

resource $outStream

Return Value

IOInterface Return self to support chaining.

at line line 105
IOInterface setErrorStream(resource $errorStream)

Method to set property errorStream

Parameters

resource $errorStream

Return Value

IOInterface Return self to support chaining.

at line line 114
IOInterface setInputStream(resource $inputStream)

setInputStream

Parameters

resource $inputStream

Return Value

IOInterface Return self to support chaining.