Orpheus

CliArgument
in package

Table of Contents

Properties

$longName  : string
The long name
$required  : bool
Is the argument required ?
$shortName  : string|null
The short name
$type  : string|null
The type
$typeValidators  : array<string|int, mixed>
Registered regex for a type

Methods

__construct()  : mixed
Constructor
getLongCommand()  : string
getLongName()  : string
Get the long name
getShortName()  : string|null
Get the short name
getType()  : string|null
Get the type
getTypeValidator()  : AbstractType
Get the type
getUsageCommand()  : string
getValidatorByType()  : AbstractType
Get a type validator by type name
getValueFrom()  : mixed
hasShortName()  : bool
Test argument has a short name
isRequired()  : bool
Is this argument required ?
isRequiringValue()  : bool
make()  : CliArgument
Make a CliArgument from config
registerTypeValidator()  : void
Add the type validator to validate parameters
setRequired()  : CliArgument
Set the required state
validateParameter()  : bool
Add the type validator to validate parameters
verify()  : bool

Properties

$required

Is the argument required ?

protected bool $required

$shortName

The short name

protected string|null $shortName

$typeValidators

Registered regex for a type

protected static array<string|int, mixed> $typeValidators = []

Methods

__construct()

Constructor

public __construct(string $longName, string|null $shortName, string|null $type[, bool $required = false ]) : mixed
Parameters
$longName : string
$shortName : string|null
$type : string|null
$required : bool = false

getLongCommand()

public getLongCommand(mixed $value[, mixed $usage = false ]) : string
Parameters
$value : mixed
$usage : mixed = false
Return values
string

getLongName()

Get the long name

public getLongName() : string
Return values
string

getShortName()

Get the short name

public getShortName() : string|null
Return values
string|null

getType()

Get the type

public getType() : string|null
Return values
string|null

getUsageCommand()

public getUsageCommand() : string
Return values
string

getValueFrom()

public getValueFrom(mixed $values) : mixed
Parameters
$values : mixed

hasShortName()

Test argument has a short name

public hasShortName() : bool
Return values
bool

isRequired()

Is this argument required ?

public isRequired() : bool
Return values
bool

isRequiringValue()

public isRequiringValue() : bool
Return values
bool

make()

Make a CliArgument from config

public static make(string $name, string $config) : CliArgument
Parameters
$name : string
$config : string
Return values
CliArgument

validateParameter()

Add the type validator to validate parameters

public static validateParameter(string $type, mixed $value) : bool
Parameters
$type : string
$value : mixed
Return values
bool

verify()

public verify(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

							
On this page

Search results