Represents a command line argument.
- author Fabien Potencier
CloneableInstantiable
Constants |
public Symfony The argument accepts multiple values and turn them into an array (e.g. 'app:foo bar baz' will result in value ['bar', 'baz']). |
public Symfony Providing an argument is optional (e.g. 'app:foo' and 'app:foo bar' are both allowed). This is the default behavior of arguments. |
public Symfony Providing an argument is required (e.g. just 'app:foo' is not allowed). |
Methods |
public __construct(string $name, ?int $mode = NULL, string $description = '', array|string|int|float|bool|?null $default = NULL, Closure|array $suggestedValues = [])
|
public complete(Symfony Supplies suggestions when command resolves possible completion options for input.
|
public getDefault() : array|string|int|float|bool|?null Returns the default value. |
public getDescription() : string Returns the description text. |
public getName() : string Returns the argument name. |
public hasCompletion() : bool Returns true if the argument has values for input completion. |
public isArray() : bool Returns true if the argument can take multiple values.
|
public isRequired() : bool Returns true if the argument is required.
|
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 Closure|array $suggestedValues |