Option
Option
Value object describing a command-line option definition.
class OptionStores long/short flag names, value requirements, defaults, and optional type metadata used by the console input parser when validating and normalizing command options.
Properties
long
The long name of the option. Must start with a letter and contain only alphanumeric characters, dashes, or underscores.
public string $longshort
The short, single-character name of the option, or null if not used. Must be a single letter.
public string $shortdescription
A description of what the option does
public string $descriptiontakesValue
Whether this option accepts a value
public bool $takesValuedefault
The default value if the option is not provided and takesValue is true
public mixed $defaultrequired
Whether this option is mandatory
public bool $requiredvalueType
The expected type of the value (e.g., 'int', 'string'), if applicable.
public string $valueTypeMethods
__construct
Constructor for the Option class.
public __construct(string $long, string $short, string $description, bool $takesValue, mixed $default, bool $required, string $valueType): voidParameters
| Parameter | Type | Description |
|---|---|---|
$long | string | The long name of the option. Must start with a letter and contain only alphanumeric characters, dashes, or underscores. |
$short | string | The short, single-character name of the option, or null if not used. Must be a single letter. |
$description | string | A description of what the option does |
$takesValue | bool | Whether this option accepts a value |
$default | mixed | The default value if the option is not provided and takesValue is true |
$required | bool | Whether this option is mandatory |
$valueType | string | The expected type of the value (e.g., 'int', 'string'), if applicable. |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:25 +0000