core/Validate.php
public function addFunc(string $type, $func, string $error = null)
    {
        $this->func[$type] = $func;
        if (!empty($error)) {
            $this->def_errors[$type] = $error;
        }
    }
public function addFunc(string $type, $func, string $error = null)
    {
        $this->func[$type] = $func;
        if (!empty($error)) {
            $this->def_errors[$type] = $error;
        }
    }
添加校验函数
@param string $type
@param $func
@param string|null $error