Properties

$sOpts

$sOpts : array

Input short-opts data

Type

array

$lOpts

$lOpts : array

Input long-opts data

Type

array

Methods

getOpt()

getOpt(string  $name, null  $default = null) : boolean|mixed|null

get (long/short)opt value eg: -e dev --name sam

Parameters

string $name
null $default

Returns

boolean|mixed|null

getOption()

getOption(string  $name, mixed  $default = null) : mixed

Alias of the getOpt()

Parameters

string $name
mixed $default

Returns

mixed

getRequiredOpt()

getRequiredOpt(string  $name, string  $errMsg = '') : mixed

Get a required option value

Parameters

string $name
string $errMsg

Returns

mixed

getStringOpt()

getStringOpt(string  $name, string  $default = '') : string

Get an string option(long/short) value

Parameters

string $name
string $default

Returns

string

getSameStringOpt()

getSameStringOpt(array<mixed,string>  $names, string  $default = '') : string

Get an string option(long/short) value

Parameters

array<mixed,string> $names

eg ['n', 'name']

string $default

Returns

string

getIntOpt()

getIntOpt(string  $name, integer  $default) : integer

Get an int option(long/short) value

Parameters

string $name
integer $default

Returns

integer

getBoolOpt()

getBoolOpt(string  $name, boolean  $default = false) : boolean

Get (long/short)option value(bool) eg: -h --help

Parameters

string $name
boolean $default

Returns

boolean

getSameBoolOpt()

getSameBoolOpt(array<mixed,string>  $names, boolean  $default = false) : boolean

Get (long/short)option value(bool) eg: -h --help

Parameters

array<mixed,string> $names
boolean $default

Returns

boolean

boolOpt()

boolOpt(string  $name, boolean  $default = false) : boolean

Alias of the getBoolOpt()

Parameters

string $name
boolean $default

Returns

boolean

hasOpt()

hasOpt(  $name) : boolean

check option exists

Parameters

$name

Returns

boolean

getSameOpt()

getSameOpt(array  $names, mixed  $default = null) : boolean|mixed|null

Get same opts value eg: -h --help

$input->sameOpt(['h','help']);

Parameters

array $names
mixed $default

Returns

boolean|mixed|null

sameOpt()

sameOpt(array  $names, null  $default = null) : boolean|mixed|null

Alias of the getSameOpt()

Parameters

array $names
null $default

Returns

boolean|mixed|null

getOpts()

getOpts() : array

Returns

array

getOptions()

getOptions() : array

Returns

array

clearOpts()

clearOpts() 

clear (l/s)opts

sOpt()

sOpt(string  $name, null  $default = null) : mixed|null

Get short-opt value

Parameters

string $name
null $default

Returns

mixed|null

shortOpt()

shortOpt(string  $name, null  $default = null) : mixed|null

Alias of the sOpt()

Parameters

string $name
null $default

Returns

mixed|null

getShortOpt()

getShortOpt(string  $name, null  $default = null) : mixed|null

Alias of the sOpt()

Parameters

string $name
null $default

Returns

mixed|null

hasSOpt()

hasSOpt(string  $name) : boolean

Check short-opt exists

Parameters

string $name

Returns

boolean

findOneShortOpts()

findOneShortOpts(array<mixed,string>  $names) : string

Check multi short-opt exists

Parameters

array<mixed,string> $names

Returns

string

sBoolOpt()

sBoolOpt(string  $name, boolean  $default = false) : boolean

get short-opt value(bool)

Parameters

string $name
boolean $default

Returns

boolean

getShortOpts()

getShortOpts() : array

Returns

array

setSOpt()

setSOpt(string  $name, mixed  $value) 

Parameters

string $name
mixed $value

getSOpts()

getSOpts() : array

Returns

array

setSOpts()

setSOpts(array  $sOpts, boolean  $replace = false) 

Parameters

array $sOpts
boolean $replace

clearSOpts()

clearSOpts() 

clear s-opts

lOpt()

lOpt(string  $name, null  $default = null) : mixed|null

Alias of the getLongOpt()

Parameters

string $name
null $default

Returns

mixed|null

longOpt()

longOpt(string  $name, null  $default = null) : mixed|null

Alias of the getLongOpt()

Parameters

string $name
null $default

Returns

mixed|null

getLongOpt()

getLongOpt(string  $name, null  $default = null) : mixed|null

Get long-opt value

Parameters

string $name
null $default

Returns

mixed|null

hasLOpt()

hasLOpt(string  $name) : boolean

check long-opt exists

Parameters

string $name

Returns

boolean

lBoolOpt()

lBoolOpt(string  $name, boolean  $default = false) : boolean

get long-opt value(bool)

Parameters

string $name
boolean $default

Returns

boolean

getLongOpts()

getLongOpts() : array

Returns

array

setLOpt()

setLOpt(string  $name,   $value) 

Parameters

string $name
$value

getLOpts()

getLOpts() : array

Returns

array

setLOpts()

setLOpts(array  $lOpts, boolean  $replace = false) 

Parameters

array $lOpts
boolean $replace

clearLOpts()

clearLOpts() 

clear lang opts