PHP Class think\console\input\Argument

Show file Open project: top-think/framework Class Usage Examples

Public Methods

Method Description
__construct ( string $name, integer $mode = null, string $description = '', mixed $default = null ) 构造方法
getDefault ( ) : mixed 获取默认值
getDescription ( ) : string 获取描述
getName ( ) : string 获取参数名
isArray ( ) : boolean 该参数是否接受数组
isRequired ( ) : boolean 是否必须
setDefault ( mixed $default = null ) 设置默认值

Method Details

__construct() public method

构造方法
public __construct ( string $name, integer $mode = null, string $description = '', mixed $default = null )
$name string 参数名
$mode integer 参数类型: self::REQUIRED 或者 self::OPTIONAL
$description string 描述
$default mixed 默认值 (仅 self::OPTIONAL 类型有效)

getDefault() public method

获取默认值
public getDefault ( ) : mixed
return mixed

getDescription() public method

获取描述
public getDescription ( ) : string
return string

getName() public method

获取参数名
public getName ( ) : string
return string

isArray() public method

该参数是否接受数组
public isArray ( ) : boolean
return boolean

isRequired() public method

是否必须
public isRequired ( ) : boolean
return boolean

setDefault() public method

设置默认值
public setDefault ( mixed $default = null )
$default mixed 默认值