프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$input | array | 客户端数据 | |
$state | array | 发送状态 | |
$storage | Toplan\Sms\Storage | 存储器 | |
$token | string | null | Access Token |
메소드 | 설명 | |
---|---|---|
__construct ( string | null $token = null, array $input = [] ) | Constructor | |
forgetRule ( string $field, string | null $name = null ) | 从存储器中删除指定字段的指定名称的动态验证规则 | |
forgetRules ( string $field ) : array | 从存储中获取指定字段的所有验证规则 | |
forgetState ( ) | 从存储器中删除发送状态 | |
generateResult ( boolean $pass, string $type, string $message = '', array $data = [] ) : array | 合成结果数组 | |
getCanResendTime ( ) : integer | 从存储器中获取可再次发送的截止时间 | |
input ( string | integer | null $key = null, mixed $default = null ) : mixed | 获取客户端数据 | |
pathOfUrl ( string $url, Closure $onError = null ) : string | 获取路径中的path部分 | |
requestVerifySms ( ) : array | 请求验证码短信 | |
requestVoiceVerify ( ) : array | 请求语音验证码 | |
retrieveAllData ( ) : array | 从存储器中获取用户的所有数据 | |
retrieveRule ( string $field, string | null $name = null ) : string | null | 从存储器中获取指定字段的指定名称的动态验证规则 | |
retrieveRules ( string $field ) : array | 从存储中获取指定字段的所有验证规则 | |
retrieveState ( string | null $name = null ) : array | 从存储器中获取发送状态 | |
setCanResendAfter ( integer $interval ) : integer | 设置多少秒后才能再次请求 | |
state ( string | integer | null $key = null, mixed $default = null ) : mixed | 获取当前的发送状态(非持久化的) | |
storeRule ( string $field, string $name, string | null $rule = null ) | 存储指定字段的指定名称的动态验证规则 | |
updateState ( string | array $name, mixed $value = null ) | 更新发送状态 | |
validateFields ( mixed $input = null, Closure $validation = null ) : array | 验证数据 | |
validateSendable ( ) : array | 验证是否可发送 | |
vsprintf ( string $template, array $data, Closure $onError = null ) : string | 根据模版和数据合成字符串 |
메소드 | 설명 | |
---|---|---|
generateCode ( integer | null $length = null, string | null $characters = null ) : string | 根据配置文件中的长度生成验证码 | |
generateKey ( ) : string | 生成key | |
generateSmsContent ( string $code, integer $minutes ) : string | 生成验证码短信通用内容 | |
generateTemplateData ( string $code, integer $minutes, string $type ) : array | 生成模版数据 | |
getCodeValidMinutes ( ) : integer | 从配置文件获取验证码有效时间(分钟) | |
getFields ( ) : array | 获取可验证的字段 | |
getInterval ( ) : integer | 从配置文件获取可再次请求的最小时间间隔(秒) | |
getMobileField ( ) : string | 获取手机号的字段名 | |
getNameOfDefaultStaticRule ( string $field ) : string | 获取指定字段的默认静态规则的名称 | |
getNotifyMessage ( string $name ) : string | 从配置文件获取提示信息 | |
getRealRuleByName ( string $field, string $ruleName ) : string | 根据规则名获取真实的验证规则 | |
getStaticRule ( $field, $ruleName ) : string | null | 获取指定字段的指定名称的静态验证规则 | |
getStorageClassName ( ) : string | 获取存储器类名 | |
getTemplatesByKey ( string $key ) : array | 从配置信息中获取指定键名的所有模版id | |
getValidationConfigByField ( string $field ) : array | 获取验证配置 | |
reset ( ) | 重置发送状态 | |
storage ( ) : Toplan\Sms\Storage | 获取存储器 | |
storeState ( ) | 存储发送状态 | |
useRule ( string $field, string $name ) | 设置指定字段使用的验证规则名称 | |
usedRule ( string $field ) : string | 获取设置指定字段使用的验证规则名称 | |
validateFieldName ( $name ) | 检查字段名称是否合法 | |
verifyCode ( ) : string | 生成待发生的验证码 | |
whetherValidateFiled ( string $field ) : boolean | 是否检查指定的数据 |
public forgetRules ( string $field ) : array | ||
$field | string | |
리턴 | array |
protected static getCodeValidMinutes ( ) : integer | ||
리턴 | integer |
protected static getInterval ( ) : integer | ||
리턴 | integer |
protected static getNameOfDefaultStaticRule ( string $field ) : string | ||
$field | string | |
리턴 | string |
protected static getNotifyMessage ( string $name ) : string | ||
$name | string | |
리턴 | string |
protected static getStaticRule ( $field, $ruleName ) : string | null | ||
$field | ||
$ruleName | ||
리턴 | string | null |
protected static getStorageClassName ( ) : string | ||
리턴 | string |
protected static getTemplatesByKey ( string $key ) : array | ||
$key | string | |
리턴 | array |
protected static getValidationConfigByField ( string $field ) : array | ||
$field | string | |
리턴 | array |
public retrieveRules ( string $field ) : array | ||
$field | string | |
리턴 | array |
public setCanResendAfter ( integer $interval ) : integer | ||
$interval | integer | |
리턴 | integer |
protected static whetherValidateFiled ( string $field ) : boolean | ||
$field | string | |
리턴 | boolean |