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

Public Member Functions

 getFirstArgument ()
 
 hasParameterOption ($values)
 
 getParameterOption ($values, $default=false)
 
 bind (InputDefinition $definition)
 
 validate ()
 
 getArguments ()
 
 getArgument ($name)
 
 setArgument ($name, $value)
 
 hasArgument ($name)
 
 getOptions ()
 
 getOption ($name)
 
 setOption ($name, $value)
 
 hasOption ($name)
 
 isInteractive ()
 
 setInteractive ($interactive)
 

Detailed Description

InputInterface is the interface implemented by all input classes.

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

Definition at line 19 of file InputInterface.php.

Member Function Documentation

bind ( InputDefinition  $definition)

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

Parameters
InputDefinition$definitionA InputDefinition instance

Implemented in Input.

Referenced by Command\run().

getArgument (   $name)

Gets argument by name.

Parameters
string$nameThe name of the argument
Returns
mixed

Implemented in Input.

Referenced by HelpCommand\execute().

getArguments ( )

Returns all the given arguments merged with the default values.

Returns
array

Implemented in Input.

getFirstArgument ( )

Returns the first argument from the raw parameters (not parsed).

Returns
string The value of the first argument or null otherwise

Implemented in ArgvInput, and ArrayInput.

Referenced by Application\getCommandName(), and CliRequestHandler\validateCommandLineKeyFromInput().

getOption (   $name)

Gets an option by name.

Parameters
string$nameThe name of the option
Returns
mixed

Implemented in Input.

Referenced by HelpCommand\execute().

getOptions ( )

Returns all the given options merged with the default values.

Returns
array

Implemented in Input.

getParameterOption (   $values,
  $default = false 
)

Returns the value of a raw option (not parsed).

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully.

Parameters
string | array$valuesThe value(s) to look for in the raw parameters (can be an array)
mixed$defaultThe default value to return if no result is found
Returns
mixed The option value

Implemented in ArgvInput, and ArrayInput.

Referenced by Application\configureIO().

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

Implemented in Input.

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

Implemented in Input.

hasParameterOption (   $values)

Returns true if the raw parameters (not parsed) contain a value.

This method is to be used to introspect the input parameters before they have been validated. It must be used carefully.

Parameters
string | array$valuesThe values to look for in the raw parameters (can be an array)
Returns
bool true if the value is contained in the raw parameters

Implemented in ArgvInput, and ArrayInput.

Referenced by Application\configureIO(), and Application\doRun().

isInteractive ( )

Is this input means interactive?

Returns
bool

Implemented in Input.

Referenced by QuestionHelper\ask(), and Command\run().

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

Implemented in Input.

setInteractive (   $interactive)

Sets the input interactivity.

Parameters
bool$interactiveIf the input should be interactive

Implemented in Input.

Referenced by Application\configureIO().

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

Implemented in Input.

Referenced by HelpCommand\execute().

validate ( )

Validates if arguments given are correct.

Throws an exception when not enough arguments are given.

Exceptions
\RuntimeException

Implemented in Input.

Referenced by Command\run().