PHP Класс Commando\Option

This is merely for intellisense purposes!
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string | integer $name ) : Option
__toString ( ) : string
addAlias ( string $alias ) : Option
getAliases ( ) : string[]
getDefault ( ) : mixed
getDescription ( ) : string
getHelp ( ) : string
getName ( ) : string | integer
getNeeds ( ) : string[] Get the current set of this option's requirements
getType ( ) : integer
getValue ( ) : mixed
hasNeeds ( array $optionsList ) : boolean | array Check to see if requirements list for option are met
isBoolean ( ) : boolean
isFile ( ) : boolean
isIncrement ( ) : boolean
isRequired ( ) : boolean
map ( Closure | string $value ) : Option
parseFilePath ( string $file_path ) : string | array
setBoolean ( boolean $bool = true ) : Option
setDefault ( mixed $value ) : Option
setDescription ( string $description ) : Option
setFileRequirements ( boolean $require_exists = true, boolean $allow_globbing = true ) : void Require that the argument is a file. This will make sure the argument is a valid file, will expand the file path provided to a full path (e.g. map relative paths), and in the case where $allow_globbing is set, supports file globbing and returns an array of matching files.
setIncrement ( integer $max ) : Option
setMap ( Closure $map ) : Option
setNeeds ( string $option ) : Option Set an option as required
setRequired ( boolean $bool = true ) : Option
setRule ( Closure | string $rule ) : Option
setTitle ( string $title ) : Option
setValue ( mixed $value )
validate ( mixed $value ) : boolean

Описание методов

__construct() публичный Метод

public __construct ( string | integer $name ) : Option
$name string | integer single char name or int index for this option
Результат Option

__toString() публичный Метод

public __toString ( ) : string
Результат string

addAlias() публичный Метод

public addAlias ( string $alias ) : Option
$alias string
Результат Option

getAliases() публичный Метод

public getAliases ( ) : string[]
Результат string[] list of aliases

getDefault() публичный Метод

public getDefault ( ) : mixed
Результат mixed

getDescription() публичный Метод

public getDescription ( ) : string
Результат string description of the option

getHelp() публичный Метод

public getHelp ( ) : string
Результат string

getName() публичный Метод

public getName ( ) : string | integer
Результат string | integer name of the option

getNeeds() публичный Метод

Get the current set of this option's requirements
public getNeeds ( ) : string[]
Результат string[] List of required options

getType() публичный Метод

public getType ( ) : integer
Результат integer type (see OPTION_TYPE_CONST)

getValue() публичный Метод

public getValue ( ) : mixed
Результат mixed value of the option

hasNeeds() публичный Метод

Check to see if requirements list for option are met
public hasNeeds ( array $optionsList ) : boolean | array
$optionsList array Set of current options defined
Результат boolean | array True if requirements met, array if not found

isBoolean() публичный Метод

public isBoolean ( ) : boolean
Результат boolean is this option a boolean

isFile() публичный Метод

public isFile ( ) : boolean
Результат boolean is this option a boolean

isIncrement() публичный Метод

public isIncrement ( ) : boolean
Результат boolean is this option an incremental option

isRequired() публичный Метод

public isRequired ( ) : boolean
Результат boolean is this option required?

map() публичный Метод

public map ( Closure | string $value ) : Option
$value Closure | string regex, closure
Результат Option

parseFilePath() публичный Метод

public parseFilePath ( string $file_path ) : string | array
$file_path string
Результат string | array full file path or an array of file paths in the case where "globbing" is supported

setBoolean() публичный Метод

public setBoolean ( boolean $bool = true ) : Option
$bool boolean
Результат Option

setDefault() публичный Метод

public setDefault ( mixed $value ) : Option
$value mixed default value
Результат Option

setDescription() публичный Метод

public setDescription ( string $description ) : Option
$description string
Результат Option

setFileRequirements() публичный Метод

Require that the argument is a file. This will make sure the argument is a valid file, will expand the file path provided to a full path (e.g. map relative paths), and in the case where $allow_globbing is set, supports file globbing and returns an array of matching files.
public setFileRequirements ( boolean $require_exists = true, boolean $allow_globbing = true ) : void
$require_exists boolean
$allow_globbing boolean
Результат void

setIncrement() публичный Метод

public setIncrement ( integer $max ) : Option
$max integer
Результат Option

setMap() публичный Метод

public setMap ( Closure $map ) : Option
$map Closure
Результат Option

setNeeds() публичный Метод

Set an option as required
public setNeeds ( string $option ) : Option
$option string Option name
Результат Option

setRequired() публичный Метод

public setRequired ( boolean $bool = true ) : Option
$bool boolean required?
Результат Option

setRule() публичный Метод

public setRule ( Closure | string $rule ) : Option
$rule Closure | string regex, closure
Результат Option

setTitle() публичный Метод

public setTitle ( string $title ) : Option
$title string
Результат Option

setValue() публичный Метод

public setValue ( mixed $value )
$value mixed for this option (set on the command line)

validate() публичный Метод

public validate ( mixed $value ) : boolean
$value mixed
Результат boolean