class Input

Input.

Properties

protected ReaderInterface $reader Reader.
protected ArgvParser $arguments Arguments.

Methods

__construct(ReaderInterface $reader, ArgvParser $arguments)

Constructor.

string
read()

Reads and returns user input.

getArgumentParser()

Returns the argument parser.

array
getArguments()

Returns all the arguments passed to the script.

mixed
getArgument(int|string $name, mixed $default = null)

Returns the argument associated with the given name.

Details

at line 40
__construct(ReaderInterface $reader, ArgvParser $arguments)

Constructor.

Parameters

ReaderInterface $reader Reader instance
ArgvParser $arguments Argument parser

at line 52
string read()

Reads and returns user input.

Return Value

string

at line 62
ArgvParser getArgumentParser()

Returns the argument parser.

Return Value

ArgvParser

at line 72
array getArguments()

Returns all the arguments passed to the script.

Return Value

array

at line 84
mixed getArgument(int|string $name, mixed $default = null)

Returns the argument associated with the given name.

Parameters

int|string $name Parameter number or name
mixed $default Default value

Return Value

mixed