core/Validate.php
public static function validRules(array $input = [], array $ruleMap = [], array &$errors = [], bool $suspend = false)
    {
        if (Validate::$default_errors == null) {
            Validate::$default_errors = Config::get('form.validate_default_errors', []);
        }
        $tempErrors = [];
        $result = true;
        foreach ($ruleMap as $key => $item) {
            $tempErrors[$key] = '';
            if (!isset($item['rule'])) {
                $item['rule'] = null;
            }
            if (!isset($item['message'])) {
                $item['message'] = null;
            }
            if (isset($input[$key])) {
                $result = self::checkValue($input[$key], $item['rule'], $item['message'], $tempErrors[$key]) && $result;
            } else {
                $result = self::checkValue(null, $item['rule'], $item['message'], $tempErrors[$key]) && $result;
            }
            if (!$result) {
                $errors[$key] = $tempErrors[$key];
            }
            if ($suspend && !$result) {
                return false;
            }
        }
        return $result;
    }
public static function validRules(array $input = [], array $ruleMap = [], array &$errors = [], bool $suspend = false)
    {
        if (Validate::$default_errors == null) {
            Validate::$default_errors = Config::get('form.validate_default_errors', []);
        }
        $tempErrors = [];
        $result = true;
        foreach ($ruleMap as $key => $item) {
            $tempErrors[$key] = '';
            if (!isset($item['rule'])) {
                $item['rule'] = null;
            }
            if (!isset($item['message'])) {
                $item['message'] = null;
            }
            if (isset($input[$key])) {
                $result = self::checkValue($input[$key], $item['rule'], $item['message'], $tempErrors[$key]) && $result;
            } else {
                $result = self::checkValue(null, $item['rule'], $item['message'], $tempErrors[$key]) && $result;
            }
            if (!$result) {
                $errors[$key] = $tempErrors[$key];
            }
            if ($suspend && !$result) {
                return false;
            }
        }
        return $result;
    }
验证数据返回错误集合
@param array $rule