TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Input Class Reference
Inheritance diagram for Input:
InputInterface ArgvInput ArrayInput StringInput

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
 

Detailed Description

Input is the base class for all concrete Input classes.

Three concrete classes are provided by default:

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 25 of file Input.php.

Constructor & Destructor Documentation

__construct ( InputDefinition  $definition = null)

Constructor.

Parameters
InputDefinition$definitionA InputDefinition instance

Definition at line 40 of file Input.php.

References Input\$definition, Input\bind(), and Input\validate().

Member Function Documentation

bind ( InputDefinition  $definition)

Binds the current Input instance with the given arguments and options.

Parameters
InputDefinition$definitionA 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.

Parameters
string$token
Returns
string

Definition at line 222 of file Input.php.

Referenced by ArrayInput\__toString().

getArgument (   $name)

Returns the argument value for a given argument name.

Parameters
string$nameThe argument name
Returns
mixed The argument value
Exceptions
\InvalidArgumentExceptionWhen argument given doesn't exist

Implements InputInterface.

Definition at line 120 of file Input.php.

getArguments ( )

Returns the argument values.

Returns
array An array of 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.

Parameters
string$nameThe option name
Returns
mixed The option value
Exceptions
\InvalidArgumentExceptionWhen option given doesn't exist

Implements InputInterface.

Definition at line 177 of file Input.php.

getOptions ( )

Returns the options values.

Returns
array An array of option 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.

Parameters
string | int$nameThe InputArgument name or position
Returns
bool true if the InputArgument object exists, false otherwise

Implements InputInterface.

Definition at line 153 of file Input.php.

hasOption (   $name)

Returns true if an InputOption object exists by name.

Parameters
string$nameThe InputOption name
Returns
bool true if the InputOption object exists, false otherwise

Implements InputInterface.

Definition at line 210 of file Input.php.

isInteractive ( )

Checks if the input is interactive.

Returns
bool Returns true if the input is interactive

Implements InputInterface.

Definition at line 86 of file Input.php.

References Input\$interactive.

parse ( )
abstractprotected

Processes command line arguments.

Referenced by Input\bind().

setArgument (   $name,
  $value 
)

Sets an argument value by name.

Parameters
string$nameThe argument name
string$valueThe argument value
Exceptions
\InvalidArgumentExceptionWhen argument given doesn't exist

Implements InputInterface.

Definition at line 137 of file Input.php.

setInteractive (   $interactive)

Sets the input interactivity.

Parameters
bool$interactiveIf 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.

Parameters
string$nameThe option name
string | bool$valueThe option value
Exceptions
\InvalidArgumentExceptionWhen option given doesn't exist

Implements InputInterface.

Definition at line 194 of file Input.php.

validate ( )

Validates the input.

Exceptions
\RuntimeExceptionWhen not enough arguments are given

Implements InputInterface.

Definition at line 74 of file Input.php.

Referenced by Input\__construct().

Member Data Documentation

$arguments = array()
protected

Definition at line 32 of file Input.php.

Referenced by Input\getArguments().

$definition
protected
$interactive = true
protected

Definition at line 33 of file Input.php.

Referenced by Input\isInteractive(), and Input\setInteractive().

$options = array()
protected

Definition at line 31 of file Input.php.

Referenced by Input\getOptions().