\app\framework\Component\Console\InputInputOption

Represents a command line option.

Summary

Methods
Properties
Constants
__construct()
getShortcut()
acceptValue()
isValueRequired()
isValueOptional()
isArray()
getName()
getDefault()
getDescription()
setDefault()
equals()
No public properties found
VALUE_NONE
VALUE_REQUIRED
VALUE_OPTIONAL
VALUE_IS_ARRAY
No protected methods found
No protected properties found
N/A
No private methods found
$name
$shortcut
$mode
$default
$description
N/A

Constants

VALUE_NONE

VALUE_NONE

VALUE_REQUIRED

VALUE_REQUIRED

VALUE_OPTIONAL

VALUE_OPTIONAL

VALUE_IS_ARRAY

VALUE_IS_ARRAY

Properties

$name

$name : 

Type

$shortcut

$shortcut : 

Type

$mode

$mode : 

Type

$default

$default : 

Type

$description

$description : 

Type

Methods

__construct()

__construct(  $name,   $shortcut = null,   $mode = null,   $description = '',   $default = null) 

InputOption constructor.

Parameters

$name
$shortcut
$mode
$description
$default

getShortcut()

getShortcut() : string

Returns the option shortcut.

Returns

string —

The shortcut

acceptValue()

acceptValue() : boolean

Returns true if the option accepts a value.

Returns

boolean —

true if value mode is not self::VALUE_NONE, false otherwise

isValueRequired()

isValueRequired() : boolean

Returns true if the option requires a value.

Returns

boolean —

true if mode is self::VALUE_REQUIRED, otherwise false

isValueOptional()

isValueOptional() : boolean

Returns true if the option takes a optional value.

Returns

boolean —

true if mode is self::VALUE_OPTIONAL, otherwise false

isArray()

isArray() : boolean

Returns true if the option can take multiple values.

Returns

boolean —

true if mode is self::VALUE_IS_ARRAY, false otherwise.

getName()

getName() : mixed

Returns the name.

Returns

mixed

getDefault()

getDefault() : mixed

Returns the default value.

Returns

mixed

getDescription()

getDescription() : string

Returns the description text.

Returns

string

setDefault()

setDefault(mixed  $default = null) 

Sets the default value.

Parameters

mixed $default