\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

$mode

$mode

$default

$default

$description

$description

Methods

__construct()

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

构造方法

Parameters

string $name

参数名

int $mode

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

string $description

描述

mixed $default

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

Throws

\InvalidArgumentException

Returns

mixed —

getName()

getName() : string

获取参数名

Returns

string —

isRequired()

isRequired() : bool

是否必须

Returns

bool —

isArray()

isArray() : bool

该参数是否接受数组

Returns

bool —

setDefault()

setDefault(mixed  $default = null) : mixed

设置默认值

Parameters

mixed $default

默认值

Throws

\LogicException

Returns

mixed —

getDefault()

getDefault() : mixed

获取默认值

Returns

mixed —

getDescription()

getDescription() : string

获取描述

Returns

string —