class InputArgument
Represents a command line argument.
REQUIRED | |
OPTIONAL | |
IS_ARRAY |
__construct(string $name, int $mode = null, string $description = '', string|string[]|null $default = null) | ||
string | getName() Returns the argument name. | |
bool | isRequired() Returns true if the argument is required. | |
bool | isArray() Returns true if the argument can take multiple values. | |
setDefault(string|string[]|null $default = null) Sets the default value. | ||
string|string[]|null | getDefault() Returns the default value. | |
string | getDescription() Returns the description text. |
string | $name | The argument name |
int | $mode | The argument mode: self::REQUIRED or self::OPTIONAL |
string | $description | A description text |
string|string[]|null | $default | The default value (for self::OPTIONAL mode only) |
InvalidArgumentException | When argument mode is not valid |
Returns the argument name.
string | The argument name |
Returns true if the argument is required.
bool | true if parameter mode is self::REQUIRED, false otherwise |
Returns true if the argument can take multiple values.
bool | true if mode is self::IS_ARRAY, false otherwise |
Sets the default value.
string|string[]|null | $default | The default value |
LogicException | When incorrect default value is given |
Returns the default value.
string|string[]|null | The default value |
Returns the description text.
string | The description text |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Console/Input/InputArgument.html