Class Symfony\Component\Console\Input\InputArgument

InheritanceSymfony\Component\Console\Input\InputArgument

Represents a command line argument.

Method Details

__construct() public method

Constructor.

public void __construct ( $name, $mode null, $description '', $default null )
$name string

The argument name

$mode int

The argument mode: self::REQUIRED or self::OPTIONAL

$description string

A description text

$default mixed

The default value (for self::OPTIONAL mode only)

throws Symfony\Component\Console\Exception\InvalidArgumentException

When argument mode is not valid

getDefault() public method

Returns the default value.

public mixed getDefault ( )
return mixed

The default value

getDescription() public method

Returns the description text.

public string getDescription ( )
return string

The description text

getName() public method

Returns the argument name.

public string getName ( )
return string

The argument name

isArray() public method

Returns true if the argument can take multiple values.

public bool isArray ( )
return bool

True if mode is self::IS_ARRAY, false otherwise

isRequired() public method

Returns true if the argument is required.

public bool isRequired ( )
return bool

True if parameter mode is self::REQUIRED, false otherwise

setDefault() public method

Sets the default value.

public void setDefault ( $default null )
$default mixed

The default value

throws Symfony\Component\Console\Exception\LogicException

When incorrect default value is given