Properties

$name

$name : string

参数名称 属性注解可省略

Type

string

$optional

$optional : boolean

非必验证,只有当值存在才验证

Type

boolean

$default

$default : mixed

当值不符合条件时的默认值

Type

mixed

$inverseResult

$inverseResult : boolean

对结果取反

Type

boolean

$message

$message : string

当验证条件不符合时的信息

支持代入{:value}原始值 支持代入{:data.xxx}所有数据中的某项 支持以{name}这样的形式,代入注解参数值

Type

string

$callable

$callable : callable

验证回调

Type

callable

$args

$args : array

参数名数组

支持代入{:value}原始值 支持代入{:data}所有数据 支持代入{:data.xxx}所有数据中的某项 支持以{name}这样的形式,代入注解参数值 如果没有{},则原样传值

Type

array

$exception

$exception : string

异常类

Type

string

$exCode

$exCode : integer

异常编码

Type

integer

$defaultFieldName

$defaultFieldName : string

只传一个参数时的参数名

Type

string

$data

$data : array

数据

Type

array

Methods

__construct()

__construct(  $data = array()) 

Parameters

$data

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

__wakeup()

__wakeup() 

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

current()

current() 

key()

key() 

next()

next() 

rewind()

rewind() 

valid()

valid() 

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(  $name) 

Parameters

$name

__unset()

__unset(  $name) 

Parameters

$name

toArray()

toArray() : array

将当前对象作为数组返回

Returns

array

jsonSerialize()

jsonSerialize() : array

json 序列化

Returns

array