TYPO3
7.6
|
Public Member Functions | |
__construct (InputDefinition $definition=null) | |
bind (InputDefinition $definition) | |
validate () | |
isInteractive () | |
setInteractive ($interactive) | |
getArguments () | |
getArgument ($name) | |
setArgument ($name, $value) | |
hasArgument ($name) | |
getOptions () | |
getOption ($name) | |
setOption ($name, $value) | |
hasOption ($name) | |
escapeToken ($token) | |
Public Member Functions inherited from InputInterface | |
getFirstArgument () | |
hasParameterOption ($values) | |
getParameterOption ($values, $default=false) | |
Protected Member Functions | |
parse () | |
Protected Attributes | |
$definition | |
$options = array() | |
$arguments = array() | |
$interactive = true | |
Input is the base class for all concrete Input classes.
Three concrete classes are provided by default:
ArgvInput
: The input comes from the CLI arguments (argv)StringInput
: The input is provided as a stringArrayInput
: The input is provided as an array__construct | ( | InputDefinition | $definition = null | ) |
Constructor.
InputDefinition | $definition | A InputDefinition instance |
Definition at line 40 of file Input.php.
References Input\$definition, Input\bind(), and Input\validate().
bind | ( | InputDefinition | $definition | ) |
Binds the current Input instance with the given arguments and options.
InputDefinition | $definition | A InputDefinition instance |
Implements InputInterface.
Definition at line 55 of file Input.php.
References Input\$definition, and Input\parse().
Referenced by Input\__construct(), and StringInput\__construct().
escapeToken | ( | $token | ) |
Escapes a token through escapeshellarg if it contains unsafe chars.
string | $token |
Definition at line 222 of file Input.php.
Referenced by ArrayInput\__toString().
getArgument | ( | $name | ) |
Returns the argument value for a given argument name.
string | $name | The argument name |
\InvalidArgumentException | When argument given doesn't exist |
Implements InputInterface.
getArguments | ( | ) |
Returns the argument values.
Implements InputInterface.
Definition at line 106 of file Input.php.
References Input\$arguments.
getOption | ( | $name | ) |
Returns the option value for a given option name.
string | $name | The option name |
\InvalidArgumentException | When option given doesn't exist |
Implements InputInterface.
getOptions | ( | ) |
Returns the options values.
Implements InputInterface.
Definition at line 163 of file Input.php.
References Input\$options.
hasArgument | ( | $name | ) |
Returns true if an InputArgument object exists by name or position.
string | int | $name | The InputArgument name or position |
Implements InputInterface.
hasOption | ( | $name | ) |
Returns true if an InputOption object exists by name.
string | $name | The InputOption name |
Implements InputInterface.
isInteractive | ( | ) |
Checks if the input is interactive.
Implements InputInterface.
Definition at line 86 of file Input.php.
References Input\$interactive.
|
abstractprotected |
Processes command line arguments.
Referenced by Input\bind().
setArgument | ( | $name, | |
$value | |||
) |
Sets an argument value by name.
string | $name | The argument name |
string | $value | The argument value |
\InvalidArgumentException | When argument given doesn't exist |
Implements InputInterface.
setInteractive | ( | $interactive | ) |
Sets the input interactivity.
bool | $interactive | If the input should be interactive |
Implements InputInterface.
Definition at line 96 of file Input.php.
References Input\$interactive.
setOption | ( | $name, | |
$value | |||
) |
Sets an option value by name.
string | $name | The option name |
string | bool | $value | The option value |
\InvalidArgumentException | When option given doesn't exist |
Implements InputInterface.
validate | ( | ) |
Validates the input.
\RuntimeException | When not enough arguments are given |
Implements InputInterface.
Definition at line 74 of file Input.php.
Referenced by Input\__construct().
|
protected |
Definition at line 32 of file Input.php.
Referenced by Input\getArguments().
|
protected |
Definition at line 30 of file Input.php.
Referenced by ArrayInput\__construct(), StringInput\__construct(), Input\__construct(), ArgvInput\__construct(), and Input\bind().
|
protected |
Definition at line 33 of file Input.php.
Referenced by Input\isInteractive(), and Input\setInteractive().
|
protected |
Definition at line 31 of file Input.php.
Referenced by Input\getOptions().