Argument
class Argument
Argument.
Constants
IS_INT |
Integer flag. |
IS_FLOAT |
Float flag. |
IS_BOOL |
Boolean flag. |
IS_ARRAY |
Array flag. |
IS_OPTIONAL |
Optional flag. |
NAME_REGEX |
Regex that matches allowed parameter names. |
ALIAS_REGEX |
Regex that matches allowed aliases. |
Properties
protected string | $name | Argument name. | |
protected string|null | $alias | Argument alias. | |
protected bool | $isPositional | Is the argument positional? | |
protected string | $description | Argument description. | |
protected int | $options | Argument options. | |
protected mixed | $default | Default value. |
Methods
Constructor.
Gets the default return value.
Returns a validated argument name.
Returns a validated alias.
Parse the argument name.
Returns validated options.
Returns the argument name.
Returns the normalized argument name.
Returns the argument alias.
Returns the argument description.
Is the argument positional?
Is the argument an integer?
Is the argument a float?
Is the argument a boolean?
Is the argument an array?
Is the argument optional?
Details
at line 125
__construct(string $name, string $description = '', int $options = 0, mixed $default = null)
Constructor.
at line 152
mixed
getDefaultValue()
Gets the default return value.
at line 163
protected string
getValidatedName(string $name)
Returns a validated argument name.
at line 179
protected string
getValidatedAlias(string $alias)
Returns a validated alias.
at line 195
protected array
parseName(string $name)
Parse the argument name.
at line 218
protected int
getValidatedOptions(int $options)
Returns validated options.
at line 253
string
getName()
Returns the argument name.
at line 263
string
getNormalizedName()
Returns the normalized argument name.
at line 273
string|null
getAlias()
Returns the argument alias.
at line 283
string
getDescription()
Returns the argument description.
at line 293
bool
isPositional()
Is the argument positional?
at line 303
bool
isInt()
Is the argument an integer?
at line 313
bool
isFloat()
Is the argument a float?
at line 323
bool
isBool()
Is the argument a boolean?
at line 333
bool
isArray()
Is the argument an array?
at line 343
bool
isOptional()
Is the argument optional?