class IO extends IO implements IOInterface, IteratorAggregate, ArrayAccess, Serializable, Countable, JsonSerializable (View source)

The IO class.

Methods

__construct(CliInputInterface $input = null, CliOutputInterface $output = null)

Class init.

from IO
out(string $text = '', boolean $nl = true)

Write a string to standard output

from IO
string
in()

Get a value from standard input.

from IO
err(string $text = '', boolean $nl = true)

Write a string to standard error output.

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

Gets a value from the input data.

from IO
void
setOption(string $name, mixed $value)

Sets a value

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

getArgument

from IO
setArgument(integer $offset, mixed $value)

setArgument

from IO
IO
setInput(CliInputInterface $input)

setInput

from IO
IO
setOutput(CliOutputInterface $output)

setOutput

from IO
mixed
getCalledScript()

getExecuted

from IO
string[]
getOptions()

getOptions

from IO
string[]
getArguments()

getArguments

from IO
void
offsetSet(mixed $offset, mixed $value)

Set value to property

from IO
void
offsetUnset(mixed $offset)

Unset a property.

from IO
boolean
offsetExists(mixed $offset)

Property is exist or not.

from IO
mixed
offsetGet(mixed $offset)

Get a value of property.

from IO
getIterator()

Get the data store for iterate.

from IO
string
serialize()

Serialize data.

from IO
IO
unserialize(string $serialized)

Unserialize the data.

from IO
int
count()

Count data.

from IO
mixed
jsonSerialize()

Serialize to json format.

from IO
setArguments(array $args)

set Arguments

string
shiftArgument()

shiftArgument

unshiftArgument(string $arg)

unshiftArgument

pushArgument(string $arg)

pushArgument

string
popArgument()

popArgument

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

addColor

useColor(boolean $bool = true)

useColor

void
__clone()

__clone

resource
getOutputStream()

getOutStream

setOutputStream(resource $outStream)

setOutStream

resource
getErrorStream()

Method to get property ErrorStream

setErrorStream(resource $errorStream)

Method to set property errorStream

resource
getInputStream()

getInputStream

setInputStream(resource $inputStream)

setInputStream

Details

in IO at line line 49
__construct(CliInputInterface $input = null, CliOutputInterface $output = null)

Class init.

Parameters

CliInputInterface $input
CliOutputInterface $output

in IO at line line 63
IOInterface out(string $text = '', boolean $nl = true)

Write a string to standard output

Parameters

string $text The text to display.
boolean $nl True (default) to append a new line at the end of the output string.

Return Value

IOInterface Instance of $this to allow chaining.

in IO at line line 75
string in()

Get a value from standard input.

Return Value

string The input string from standard input.

in IO at line line 89
IOInterface err(string $text = '', boolean $nl = true)

Write a string to standard error output.

Parameters

string $text The text to display.
boolean $nl True (default) to append a new line at the end of the output string.

Return Value

IOInterface

in IO at line line 106
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 IO at line line 121
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 IO at line line 136
mixed getArgument(integer $offset, mixed $default = null)

getArgument

Parameters

integer $offset
mixed $default

Return Value

mixed

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

setArgument

Parameters

integer $offset
mixed $value

Return Value

IOInterface

in IO at line line 161
CliInput|CliInputInterface getInput()

getInput

in IO at line line 173
IO setInput(CliInputInterface $input)

setInput

Parameters

CliInputInterface $input

Return Value

IO Return self to support chaining.

in IO at line line 197
IO setOutput(CliOutputInterface $output)

setOutput

Parameters

CliOutputInterface $output

Return Value

IO Return self to support chaining.

in IO at line line 209
mixed getCalledScript()

getExecuted

Return Value

mixed

in IO at line line 219
string[] getOptions()

getOptions

Return Value

string[]

in IO at line line 229
string[] getArguments()

getArguments

Return Value

string[]

in IO at line line 242
void offsetSet(mixed $offset, mixed $value)

Set value to property

Parameters

mixed $offset Property key.
mixed $value Property value to set.

Return Value

void

in IO at line line 254
void offsetUnset(mixed $offset)

Unset a property.

Parameters

mixed $offset Key to unset.

Return Value

void

in IO at line line 266
boolean offsetExists(mixed $offset)

Property is exist or not.

Parameters

mixed $offset Property key.

Return Value

boolean

in IO at line line 278
mixed offsetGet(mixed $offset)

Get a value of property.

Parameters

mixed $offset Property key.

Return Value

mixed The value of this property.

in IO at line line 288
Traversable getIterator()

Get the data store for iterate.

Return Value

Traversable The data to be iterator.

in IO at line line 298
string serialize()

Serialize data.

Return Value

string Serialized data string.

in IO at line line 310
IO unserialize(string $serialized)

Unserialize the data.

Parameters

string $serialized THe serialized data string.

Return Value

IO Support chaining.

in IO at line line 322
int count()

Count data.

Return Value

int

in IO at line line 332
mixed jsonSerialize()

Serialize to json format.

Return Value

mixed

at line line 34
IOInterface setArguments(array $args)

set Arguments

Parameters

array $args

Return Value

IOInterface

at line line 46
string shiftArgument()

shiftArgument

Return Value

string

at line line 58
IOInterface unshiftArgument(string $arg)

unshiftArgument

Parameters

string $arg

Return Value

IOInterface

at line line 72
IOInterface pushArgument(string $arg)

pushArgument

Parameters

string $arg

Return Value

IOInterface

at line line 84
string popArgument()

popArgument

Return Value

string

at line line 99
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 116
IOInterface useColor(boolean $bool = true)

useColor

Parameters

boolean $bool

Return Value

IOInterface

at line line 131
void __clone()

__clone

Return Value

void

at line line 142
resource getOutputStream()

getOutStream

Return Value

resource

at line line 154
IOInterface setOutputStream(resource $outStream)

setOutStream

Parameters

resource $outStream

Return Value

IOInterface Return self to support chaining.

at line line 166
resource getErrorStream()

Method to get property ErrorStream

Return Value

resource

at line line 178
IOInterface setErrorStream(resource $errorStream)

Method to set property errorStream

Parameters

resource $errorStream

Return Value

IOInterface Return self to support chaining.

at line line 190
resource getInputStream()

getInputStream

Return Value

resource

at line line 202
IOInterface setInputStream(resource $inputStream)

setInputStream

Parameters

resource $inputStream

Return Value

IOInterface Return self to support chaining.