Option
class
Option
An option
- Copyright
- 2016 Appertly contributors
- License
- MIT
Constructors / Destructors
Returns | Signature and Description |
---|---|
void | __construct ( , )Creates a new Option |
Instance Methods
Returns | Signature and Description |
---|---|
string | Gets the option description. |
ImmSet <string > | getLongs ()Gets the option long aliases |
ImmSet <string > | Gets the option short aliases. |
string | getType ()Gets the option type. |
bool | Whether the option is incremental |
bool | Whether the option can be used multiple times |
bool | Whether the option can take a value |
bool | Whether the option requires a value |
bool | isSolo ()Whether the option takes no value |
mixed | parse ( )Parses an incoming value based on the type defined |
Method Details
__construct
__construct
(string
$spec
, string
$description
)Creates a new Option
Name | Type | Description |
---|---|---|
$spec | string | The option specification |
$description | string | A human readable description |
getDescription
getDescription
()Gets the option description.
Type | Description |
---|---|
string | The description |
getLongs
getLongs
()Gets the option long aliases
Type | Description |
---|---|
ImmSet <string > | The long aliases |
getShorts
getShorts
()Gets the option short aliases.
Type | Description |
---|---|
ImmSet <string > | The short aliases |
getType
getType
()Gets the option type.
Type | Description |
---|---|
string | The type: s, i, f, d |
isIncremental
isIncremental
()Whether the option is incremental
Type | Description |
---|---|
bool | the option incremental |
isMultiple
isMultiple
()Whether the option can be used multiple times
Type | Description |
---|---|
bool | true if the option is multiple |
isOptional
isOptional
()Whether the option can take a value
Type | Description |
---|---|
bool | true if the option can take a value |
isRequired
isRequired
()Whether the option requires a value
Type | Description |
---|---|
bool | true if the option requires a value |
isSolo
isSolo
()Whether the option takes no value
Type | Description |
---|---|
bool | true if the option takes no value |
parse
parse
(mixed
$value
)Parses an incoming value based on the type defined
Name | Type | Description |
---|---|---|
$value | mixed | The incoming value |
Type | Description |
---|---|
mixed | The converted value |