Represents a command line option.
- author Fabien Potencier
Constants |
public Symfony The option accepts multiple values (e.g. --dir=/foo --dir=/bar). |
public Symfony The option allows passing a negated variant (e.g. --ansi or --no-ansi). |
public Symfony Do not accept input for the option (e.g. --yell). This is the default behavior of options. |
public Symfony The option may or may not have a value (e.g. --yell or --yell=loud). |
public Symfony A value must be passed when the option is used (e.g. --iterations=5 or -i5). |
Methods |
public __construct(string $name, array|string|?null $shortcut = NULL, ?int $mode = NULL, string $description = '', array|string|int|float|bool|?null $default = NULL, Closure|array $suggestedValues = [])
|
public acceptValue() : bool Returns true if the option accepts a value.
|
public complete(Symfony Supplies suggestions when command resolves possible completion options for input.
|
public equals(self $option) : bool Checks whether the given option equals this one. |
public getDefault() : array|string|int|float|bool|?null Returns the default value. |
public getDescription() : string Returns the description text. |
public getName() : string Returns the option name. |
public getShortcut() : ?string Returns the option shortcut. |
public hasCompletion() : bool Returns true if the option has values for input completion. |
public isArray() : bool Returns true if the option can take multiple values.
|
public isNegatable() : bool Returns true if the option allows passing a negated variant.
|
public isValueOptional() : bool Returns true if the option takes an optional value.
|
public isValueRequired() : bool Returns true if the option requires a value.
|
public setDefault(array|string|int|float|bool|?null $default) : void Sets the default value. |
Properties |
private array|string|int|float|bool|?null $default |
private string $description |
private int $mode |
private string $name |
private ?string $shortcut |
private Closure|array $suggestedValues |