class LessStrictArgvInput extends ArgvInput (View source)

UnvalidatedArgvInput is an ArgvInput that never reports errors when extra options are provided.

If the last argument of the command being called is not an array argument, then an error will be thrown if there are too many arguments.

We use this instead of a IndiscriminateInputDefinition in cases where we know in advance that we wish to disable input validation for all commands. In contrast, an IndiscriminateInputDefinition is attached to individual Commands that should accept any option.

Properties

protected $additionalOptions

Methods

__construct(array $argv = null, InputDefinition $definition = null)

Constructor.

getOption($name)

{@inheritdoc}

setTokens(array $tokens)

No description

parse()

{@inheritdoc}

injectAdditionalOptions($additionalOptions)

No description

getFirstArgument()

{@inheritdoc}

hasParameterOption($values, $onlyParams = false)

{@inheritdoc}

getParameterOption($values, $default = false, $onlyParams = false)

{@inheritdoc}

string
__toString()

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

Details

__construct(array $argv = null, InputDefinition $definition = null)

Constructor.

Parameters

array $argv An array of parameters from the CLI (in the argv format)
InputDefinition $definition A InputDefinition instance

getOption($name)

{@inheritdoc}

Parameters

$name

protected setTokens(array $tokens)

Parameters

array $tokens

protected parse()

{@inheritdoc}

injectAdditionalOptions($additionalOptions)

Parameters

$additionalOptions

getFirstArgument()

{@inheritdoc}

hasParameterOption($values, $onlyParams = false)

{@inheritdoc}

Parameters

$values
$onlyParams

getParameterOption($values, $default = false, $onlyParams = false)

{@inheritdoc}

Parameters

$values
$default
$onlyParams

string __toString()

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

Return Value

string