改进Validate类的is方法,添加data参数的默认值

This commit is contained in:
thinkphp
2016-08-15 11:37:42 +08:00
parent 03ec96c7f9
commit 1440277478
2 changed files with 3 additions and 2 deletions

View File

@@ -1409,7 +1409,7 @@ class Request
* 生成请求令牌
* @access public
* @param string $name 令牌名称
* @param string|array $type 令牌生成方法
* @param mixed $type 令牌生成方法
* @return string
*/
public function token($name = '__token__', $type = 'md5')

View File

@@ -480,9 +480,10 @@ class Validate
* @access protected
* @param mixed $value 字段值
* @param string $rule 验证规则
* @param array $data 验证数据
* @return bool
*/
protected function is($value, $rule, $data)
protected function is($value, $rule, $data = [])
{
switch ($rule) {
case 'require':