Tinywan / webman-validate

the most awesome validation library for webman plugin
https://www.workerman.net/webman
Apache License 2.0
14 stars 3 forks source link

常驻内存,rule规则不释放 #2

Open yunsimple opened 1 year ago

yunsimple commented 1 year ago

假设我有请求A,有两个方法function1和function2。

在function1中我需要验证type, $validate = Validate::rule('type', 'require|number')。

在function2中我需要验证page这个参数,$validate = Validate::rule('page', 'number|max:4')。

当我验证function2中的时候,他却报出了type必须填写,他这个$validate由于是静态方法,规则会一直存在,我现在使用->only方法似乎可以解决问题,但是感觉不够优雅,一般像这种情况该如何优雅的解决问题。

Tinywan commented 1 year ago

欢迎提价PR