Methods |
public
|
__construct(
string $name,
string|array|null $shortcut = null,
int|null $mode = null,
string $description = '',
string|bool|int|float|array|null $default = null,
)
Parameters
$shortcut |
The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
|
$mode |
The option mode: One of the VALUE_* constants
|
$default |
The default value (must be null for self::VALUE_NONE)
|
Throws
|
#
|
public
|
getShortcut(): string|null
Returns the option shortcut.
Returns the option shortcut.
|
#
|
public
|
getName(): string
Returns the option name.
|
#
|
public
|
acceptValue(): bool
Returns true if the option accepts a value.
Returns true if the option accepts a value.
Returns
true if value mode is not self::VALUE_NONE, false otherwise
|
#
|
public
|
isValueRequired(): bool
Returns true if the option requires a value.
Returns true if the option requires a value.
Returns
true if value mode is self::VALUE_REQUIRED, false otherwise
|
#
|
public
|
isValueOptional(): bool
Returns true if the option takes an optional value.
Returns true if the option takes an optional value.
Returns
true if value mode is self::VALUE_OPTIONAL, false otherwise
|
#
|
public
|
isArray(): bool
Returns true if the option can take multiple values.
Returns true if the option can take multiple values.
Returns
true if mode is self::VALUE_IS_ARRAY, false otherwise
|
#
|
public
|
isNegatable(): bool
|
#
|
public
|
setDefault(string|bool|int|float|array|null $default = null)
|
#
|
public
|
getDefault(): string|bool|int|float|array|null
Returns the default value.
Returns the default value.
|
#
|
public
|
getDescription(): string
Returns the description text.
Returns the description text.
|
#
|
public
|
equals(self $option): bool
Checks whether the given option equals this one.
Checks whether the given option equals this one.
|
#
|