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

The IO class.

Methods

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

Class init.

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

Write a string to standard output

string
in()

Get a value from standard input.

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

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

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

getArgument

setArgument(integer $offset, mixed $value)

setArgument

IO
setInput(CliInputInterface $input)

setInput

IO
setOutput(CliOutputInterface $output)

setOutput

mixed
getCalledScript()

getExecuted

string[]
getOptions()

getOptions

string[]
getArguments()

getArguments

void
offsetSet(mixed $offset, mixed $value)

Set value to property

void
offsetUnset(mixed $offset)

Unset a property.

boolean
offsetExists(mixed $offset)

Property is exist or not.

mixed
offsetGet(mixed $offset)

Get a value of property.

getIterator()

Get the data store for iterate.

string
serialize()

Serialize data.

IO
unserialize(string $serialized)

Unserialize the data.

int
count()

Count data.

mixed
jsonSerialize()

Serialize to json format.

Details

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

Class init.

Parameters

CliInputInterface $input
CliOutputInterface $output

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.

at line line 75
string in()

Get a value from standard input.

Return Value

string The input string from standard input.

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

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.

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

at line line 136
mixed getArgument(integer $offset, mixed $default = null)

getArgument

Parameters

integer $offset
mixed $default

Return Value

mixed

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

setArgument

Parameters

integer $offset
mixed $value

Return Value

IOInterface

at line line 161
CliInput|CliInputInterface getInput()

getInput

at line line 173
IO setInput(CliInputInterface $input)

setInput

Parameters

CliInputInterface $input

Return Value

IO Return self to support chaining.

at line line 197
IO setOutput(CliOutputInterface $output)

setOutput

Parameters

CliOutputInterface $output

Return Value

IO Return self to support chaining.

at line line 209
mixed getCalledScript()

getExecuted

Return Value

mixed

at line line 219
string[] getOptions()

getOptions

Return Value

string[]

at line line 229
string[] getArguments()

getArguments

Return Value

string[]

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

at line line 254
void offsetUnset(mixed $offset)

Unset a property.

Parameters

mixed $offset Key to unset.

Return Value

void

at line line 266
boolean offsetExists(mixed $offset)

Property is exist or not.

Parameters

mixed $offset Property key.

Return Value

boolean

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.

at line line 288
Traversable getIterator()

Get the data store for iterate.

Return Value

Traversable The data to be iterator.

at line line 298
string serialize()

Serialize data.

Return Value

string Serialized data string.

at line line 310
IO unserialize(string $serialized)

Unserialize the data.

Parameters

string $serialized THe serialized data string.

Return Value

IO Support chaining.

at line line 322
int count()

Count data.

Return Value

int

at line line 332
mixed jsonSerialize()

Serialize to json format.

Return Value

mixed