PHP 클래스 Commando\Option

This is merely for intellisense purposes!
파일 보기 프로젝트 열기: nategood/commando 1 사용 예제들

공개 메소드들

메소드 설명
__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