Interface Symfony\Component\Console\Input\InputInterface

Implemented bySymfony\Component\Console\Input\ArgvInput, Symfony\Component\Console\Input\ArrayInput, Symfony\Component\Console\Input\Input, Symfony\Component\Console\Input\StringInput

InputInterface is the interface implemented by all input classes.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
bind() Binds the current Input instance with the given arguments and options. Symfony\Component\Console\Input\InputInterface
getArgument() Returns the argument value for a given argument name. Symfony\Component\Console\Input\InputInterface
getArguments() Returns all the given arguments merged with the default values. Symfony\Component\Console\Input\InputInterface
getFirstArgument() Returns the first argument from the raw parameters (not parsed). Symfony\Component\Console\Input\InputInterface
getOption() Returns the option value for a given option name. Symfony\Component\Console\Input\InputInterface
getOptions() Returns all the given options merged with the default values. Symfony\Component\Console\Input\InputInterface
getParameterOption() Returns the value of a raw option (not parsed). Symfony\Component\Console\Input\InputInterface
hasArgument() Returns true if an InputArgument object exists by name or position. Symfony\Component\Console\Input\InputInterface
hasOption() Returns true if an InputOption object exists by name. Symfony\Component\Console\Input\InputInterface
hasParameterOption() Returns true if the raw parameters (not parsed) contain a value. Symfony\Component\Console\Input\InputInterface
isInteractive() Is this input means interactive? Symfony\Component\Console\Input\InputInterface
setArgument() Sets an argument value by name. Symfony\Component\Console\Input\InputInterface
setInteractive() Sets the input interactivity. Symfony\Component\Console\Input\InputInterface
setOption() Sets an option value by name. Symfony\Component\Console\Input\InputInterface
validate() Validates the input. Symfony\Component\Console\Input\InputInterface

Method Details

bind() public abstract method

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

public abstract void bind ( Symfony\Component\Console\Input\InputDefinition $definition )
$definition Symfony\Component\Console\Input\InputDefinition

A InputDefinition instance

getArgument() public abstract method

Returns the argument value for a given argument name.

public abstract mixed getArgument ( $name )
$name string

The argument name

return mixed

The argument value

throws Symfony\Component\Console\Exception\InvalidArgumentException

When argument given doesn't exist

getArguments() public abstract method

Returns all the given arguments merged with the default values.

public abstract array getArguments ( )
getFirstArgument() public abstract method

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

public abstract string getFirstArgument ( )
return string

The value of the first argument or null otherwise

getOption() public abstract method

Returns the option value for a given option name.

public abstract mixed getOption ( $name )
$name string

The option name

return mixed

The option value

throws Symfony\Component\Console\Exception\InvalidArgumentException

When option given doesn't exist

getOptions() public abstract method

Returns all the given options merged with the default values.

public abstract array getOptions ( )
getParameterOption() public abstract method

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.

public abstract mixed getParameterOption ( $values, $default false, $onlyParams false )
$values string|array

The value(s) to look for in the raw parameters (can be an array)

$default mixed

The default value to return if no result is found

$onlyParams bool

Only check real parameters, skip those following an end of options (--) signal

return mixed

The option value

hasArgument() public abstract method

Returns true if an InputArgument object exists by name or position.

public abstract bool hasArgument ( $name )
$name string|int

The InputArgument name or position

return bool

True if the InputArgument object exists, false otherwise

hasOption() public abstract method

Returns true if an InputOption object exists by name.

public abstract bool hasOption ( $name )
$name string

The InputOption name

return bool

True if the InputOption object exists, false otherwise

hasParameterOption() public abstract method

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.

public abstract bool hasParameterOption ( $values, $onlyParams false )
$values string|array

The values to look for in the raw parameters (can be an array)

$onlyParams bool

Only check real parameters, skip those following an end of options (--) signal

return bool

True if the value is contained in the raw parameters

isInteractive() public abstract method

Is this input means interactive?

public abstract bool isInteractive ( )
setArgument() public abstract method

Sets an argument value by name.

public abstract void setArgument ( $name, $value )
$name string

The argument name

$value string

The argument value

throws Symfony\Component\Console\Exception\InvalidArgumentException

When argument given doesn't exist

setInteractive() public abstract method

Sets the input interactivity.

public abstract void setInteractive ( $interactive )
$interactive bool

If the input should be interactive

setOption() public abstract method

Sets an option value by name.

public abstract void setOption ( $name, $value )
$name string

The option name

$value string|bool

The option value

throws Symfony\Component\Console\Exception\InvalidArgumentException

When option given doesn't exist

validate() public abstract method

Validates the input.

public abstract void validate ( )
throws Symfony\Component\Console\Exception\RuntimeException

When not enough arguments are given