\think\console\inputArgument

Summary

Methods
Properties
Constants
__construct()
getName()
isRequired()
isArray()
setDefault()
getDefault()
getDescription()
No public properties found
REQUIRED
OPTIONAL
IS_ARRAY
No protected methods found
No protected properties found
N/A
No private methods found
$name
$mode
$default
$description
N/A

Constants

REQUIRED

REQUIRED = 1

OPTIONAL

OPTIONAL = 2

IS_ARRAY

IS_ARRAY = 4

Properties

$name

$name : 

Type

$mode

$mode : 

Type

$default

$default : 

Type

$description

$description : 

Type

Methods

__construct()

__construct(string  $name, integer  $mode = null, string  $description = '', mixed  $default = null) 

构造方法

Parameters

string $name

参数名

integer $mode

参数类型: self::REQUIRED 或者 self::OPTIONAL

string $description

描述

mixed $default

默认值 (仅 self::OPTIONAL 类型有效)

Throws

\InvalidArgumentException

getName()

getName() : string

获取参数名

Returns

string

isRequired()

isRequired() : boolean

是否必须

Returns

boolean

isArray()

isArray() : boolean

该参数是否接受数组

Returns

boolean

setDefault()

setDefault(mixed  $default = null) 

设置默认值

Parameters

mixed $default

默认值

Throws

\LogicException

getDefault()

getDefault() : mixed

获取默认值

Returns

mixed

getDescription()

getDescription() : string

获取描述

Returns

string