SymfonyComponentConsoleInputInputInterface

InputInterface is the interface implemented by all input classes.

File
vendorSymfonyComponentConsoleInputInputInterface.php
Package
Default

Tags

author

Fabien Potencier fabien@symfony.com

Methods

getFirstArgument()

getFirstArgument() : string

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

Returns

string —

The value of the first argument or null otherwise

Tags

None found

hasParameterOption()

hasParameterOption(string|array  $values) : Boolean

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 $values

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

Returns

Boolean —

true if the value is contained in the raw parameters

Tags

None found

getParameterOption()

getParameterOption(string|array  $values, mixed  $default = false) : mixed

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 $values

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

mixed $default

The default value to return if no result is found

Returns

mixed —

The option value

Tags

None found

bind()

bind(\Symfony\Component\Console\Input\InputDefinition  $definition) 

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

Parameters

SymfonyComponentConsoleInputInputDefinition $definition

A InputDefinition instance

Tags

None found

validate()

validate() 

Validates if arguments given are correct.

Throws an exception when not enough arguments are given.

Throws

RuntimeException

Tags

None found

getArguments()

getArguments() : array

Returns all the given arguments merged with the default values.

Returns

array

Tags

None found

getArgument()

getArgument(string  $name) : mixed

Gets argument by name.

Parameters

string $name

The name of the argument

Returns

mixed

Tags

None found

setArgument()

setArgument(string  $name, string  $value) 

Sets an argument value by name.

Parameters

string $name

The argument name

string $value

The argument value

Throws

InvalidArgumentException

When argument given doesn't exist

Tags

None found

hasArgument()

hasArgument(string|integer  $name) : Boolean

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

Parameters

string|integer $name

The InputArgument name or position

Returns

Boolean —

true if the InputArgument object exists, false otherwise

Tags

None found

getOptions()

getOptions() : array

Returns all the given options merged with the default values.

Returns

array

Tags

None found

getOption()

getOption(string  $name) : mixed

Gets an option by name.

Parameters

string $name

The name of the option

Returns

mixed

Tags

None found

setOption()

setOption(string  $name, string  $value) 

Sets an option value by name.

Parameters

string $name

The option name

string $value

The option value

Throws

InvalidArgumentException

When option given doesn't exist

Tags

None found

hasOption()

hasOption(string  $name) : Boolean

Returns true if an InputOption object exists by name.

Parameters

string $name

The InputOption name

Returns

Boolean —

true if the InputOption object exists, false otherwise

Tags

None found

isInteractive()

isInteractive() : Boolean

Is this input means interactive?

Returns

Boolean

Tags

None found

setInteractive()

setInteractive(Boolean  $interactive) 

Sets the input interactivity.

Parameters

Boolean $interactive

If the input should be interactive

Tags

None found