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 127
__construct(string $name, string $description = '', int $options = 0, mixed $default = null)
Constructor.
at line 154
mixed
getDefaultValue()
Gets the default return value.
at line 165
protected string
getValidatedName(string $name)
Returns a validated argument name.
at line 181
protected string
getValidatedAlias(string $alias)
Returns a validated alias.
at line 197
protected array
parseName(string $name)
Parse the argument name.
at line 220
protected int
getValidatedOptions(int $options)
Returns validated options.
at line 255
string
getName()
Returns the argument name.
at line 265
string
getNormalizedName()
Returns the normalized argument name.
at line 275
string|null
getAlias()
Returns the argument alias.
at line 285
string
getDescription()
Returns the argument description.
at line 295
bool
isPositional()
Is the argument positional?
at line 305
bool
isInt()
Is the argument an integer?
at line 315
bool
isFloat()
Is the argument a float?
at line 325
bool
isBool()
Is the argument a boolean?
at line 335
bool
isArray()
Is the argument an array?
at line 345
bool
isOptional()
Is the argument optional?