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 $longType: string
short
The short, single-character name of the option, or null if not used. Must be a single letter.
public string $shortType: string
description
A description of what the option does
public string $descriptionType: string
takesValue
Whether this option accepts a value
public bool $takesValueType: bool
default
The default value if the option is not provided and takesValue is true
public mixed $defaultType: mixed
required
Whether this option is mandatory
public bool $requiredType: bool
valueType
The expected type of the value (e.g., 'int', 'string'), if applicable.
public string $valueTypeType: string
Methods
__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 Fri, 04 Sep 2026 23:32:18 +0000