extends |
Input |
---|
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.
Methods | ||
---|---|---|
public
|
__construct(array $argv = null, InputDefinition $definition = null)
|
# |
public
|
getFirstArgument()
|
# |
public
|
hasParameterOption($values, bool $onlyParams = false)
|
# |
public
|
getParameterOption($values, $default = false, bool $onlyParams = false)
|
# |
public
|
__toString(): string
|
# |