scene($scene); } // 执行数据验证 if (!$validator->check($data)) { // 验证失败,抛出业务异常,异常信息为验证器返回的错误信息 throw new BusinessException($validator->getError()); } // 验证成功,返回原始数据 return $data; } }