Class Symfony\Component\Console\Input\ArgvInput

InheritanceSymfony\Component\Console\Input\ArgvInput » Symfony\Component\Console\Input\Input
ImplementsSymfony\Component\Console\Input\InputInterface
SubclassesSymfony\Component\Console\Input\StringInput

ArgvInput represents an input coming from the CLI arguments.

Usage:

$input = new ArgvInput();

By default, the $_SERVER['argv'] array is used for the input values.

This can be overridden by explicitly passing the input values in the constructor:

$input = new ArgvInput($_SERVER['argv']);

If you pass it yourself, don't forget that the first element of the array is the name of the running application.

When passing an argument to the constructor, be sure that it respects the same rules as the argv one. It's almost always better to use the StringInput when you want to provide your own input.

See also:

Method Details

__construct() public method

Constructor.

public void __construct ( array $argv null, Symfony\Component\Console\Input\InputDefinition $definition null )
$argv array|null

An array of parameters from the CLI (in the argv format)

$definition Symfony\Component\Console\Input\InputDefinition|null

A InputDefinition instance

__toString() public method

Returns a stringified representation of the args passed to the command.

public string __toString ( )
getFirstArgument() public method

{@inheritdoc}

public void getFirstArgument ( )
getParameterOption() public method

{@inheritdoc}

public void getParameterOption ( $values, $default false, $onlyParams false )
$values
$default
$onlyParams
hasParameterOption() public method

{@inheritdoc}

public void hasParameterOption ( $values, $onlyParams false )
$values
$onlyParams
parse() protected method

{@inheritdoc}

protected void parse ( )
setTokens() protected method

protected void setTokens ( array $tokens )
$tokens