Methods |
public
|
bindTo(mixed &$variable): static
Bind the option's value to a variable
Bind the option's value to a variable
|
#
|
public
|
name(string|null $value): $this
The name of the option (ignored if not positional; must start with a letter, number or underscore, followed by one or…
The name of the option (ignored if not positional; must start with a letter, number or underscore, followed by one or more letters, numbers, underscores or hyphens)
|
#
|
public
|
long(string|null $value): $this
The long form of the option, e.g. "verbose" (ignored if positional and name is given; must start with a letter, number…
The long form of the option, e.g. "verbose" (ignored if positional and name is given; must start with a letter, number or underscore, followed by one or more letters, numbers, underscores or hyphens)
|
#
|
public
|
short(string|null $value): $this
The short form of the option, e.g. "v" (ignored if positional; must contain one letter, number or underscore)
The short form of the option, e.g. "v" (ignored if positional; must contain one letter, number or underscore)
|
#
|
public
|
valueName(?string $value): $this
The name of the option's value as it appears in usage information
The name of the option's value as it appears in usage information
|
#
|
public
|
description(?string $value): $this
A description of the option
A description of the option
|
#
|
public
|
optionType(CliOptionType::* $value): $this
The option's type
|
#
|
public
|
valueType(CliOptionValueType::* $value): $this
The data type of the option's value
The data type of the option's value
|
#
|
public
|
allowedValues(array<string|int|bool|float>|null $value): $this
The option's possible values, indexed by lowercase value if not case-sensitive
The option's possible values, indexed by lowercase value if not case-sensitive
|
#
|
public
|
unknownValuePolicy(CliOptionValueUnknownPolicy::* $value): $this
The action taken if an unknown value is given
The action taken if an unknown value is given
|
#
|
public
|
required(bool $value = true): $this
True if the option is mandatory (default: false)
True if the option is mandatory (default: false)
|
#
|
public
|
multipleAllowed(bool $value = true): $this
True if the option may be given more than once (default: false)
True if the option may be given more than once (default: false)
|
#
|
public
|
unique(bool $value = true): $this
True if the same value may not be given more than once (default: false)
True if the same value may not be given more than once (default: false)
|
#
|
public
|
addAll(bool $value = true): $this
True if "ALL" should be added to the list of possible values when the option can be given more than once (default:…
True if "ALL" should be added to the list of possible values when the option can be given more than once (default: false)
|
#
|
public
|
defaultValue(array<string|int|bool|float>|string|int|bool|float|null $value): $this
Assigned to the option if no value is given on the command line
Assigned to the option if no value is given on the command line
|
#
|
public
|
nullable(bool $value = true): $this
True if the option's value should be null if it is not given on the command line (default: false)
True if the option's value should be null if it is not given on the command line (default: false)
|
#
|
public
|
envVariable(string|null $value): $this
The name of a value in the environment that replaces the option's default value (ignored if positional)
The name of a value in the environment that replaces the option's default value (ignored if positional)
|
#
|
public
|
delimiter(?string $value): $this
The separator between values passed to the option as a single argument
The separator between values passed to the option as a single argument
|
#
|
public
|
valueCallback((callable(array<string|int|bool|float>|string|int|bool|float): mixed)|null $value): $this
Applied to the option's value as it is assigned (see {@see CliOption::$ValueCallback})
Applied to the option's value as it is assigned (see {@see CliOption::$ValueCallback})
|
#
|
public
|
visibility(int-mask-of<CliOptionVisibility::*> $value): $this
The option's visibility to users
The option's visibility to users
|
#
|
public
|
inSchema(bool $value = true): $this
True if the option should be included when generating a JSON Schema (default: false)
True if the option should be included when generating a JSON Schema (default: false)
|
#
|
public
|
hide(bool $value = true): $this
True if the option's visibility should be {@see CliOptionVisibility::NONE} (default: false)
True if the option's visibility should be {@see CliOptionVisibility::NONE} (default: false)
|
#
|
public
|
load(): CliOption
Prepare the option for use with a command
Prepare the option for use with a command
|
#
|