SymfonyComponentConsoleInputInputArgument

Represents a command line argument.

Summary

No protected methods found
No protected properties found
N/A
No private methods found
N/A
File
vendorSymfonyComponentConsoleInputInputArgument.php
Package
Default
Class hierarchy
SymfonyComponentConsoleInputInputArgument

Tags

author

Fabien Potencier fabien@symfony.com

api

Constants

REQUIRED

REQUIRED

Tags

None found

OPTIONAL

OPTIONAL

Tags

None found

IS_ARRAY

IS_ARRAY

Tags

None found

Properties

$name

$name : 

Type

Tags

None found

$mode

$mode : 

Type

Tags

None found

$default

$default : 

Type

Tags

None found

$description

$description : 

Type

Tags

None found

Methods

__construct()

__construct(string  $name, integer  $mode = null, string  $description = '', mixed  $default = null) 

Constructor.

Parameters

string $name

The argument name

integer $mode

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

string $description

A description text

mixed $default

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

Throws

InvalidArgumentException

When argument mode is not valid

Tags

api

getName()

getName() : string

Returns the argument name.

Returns

string —

The argument name

Tags

None found

isRequired()

isRequired() : Boolean

Returns true if the argument is required.

Returns

Boolean —

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

Tags

None found

isArray()

isArray() : Boolean

Returns true if the argument can take multiple values.

Returns

Boolean —

true if mode is self::IS_ARRAY, false otherwise

Tags

None found

setDefault()

setDefault(mixed  $default = null) 

Sets the default value.

Parameters

mixed $default

The default value

Throws

LogicException

When incorrect default value is given

Tags

None found

getDefault()

getDefault() : mixed

Returns the default value.

Returns

mixed —

The default value

Tags

None found

getDescription()

getDescription() : string

Returns the description text.

Returns

string —

The description text

Tags

None found