easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.74k stars 510 forks source link

easyswoole验证器快速验证增加inArray、notInArray #529

Open Nr-zhang opened 2 years ago

Nr-zhang commented 2 years ago

背景

验证中使用快速验证,但是in相关的验证无法使用,这会变得很麻烦

提议

vendor\easyswoole\validate\src\Validate.php中的make方法236~237行改为: if(in_array($action,['inArray','notInArray'])){ //重写inArray和notInArray $validateRule->{$action}($actionArgs,false,$errMsg); }else{ $actionArgs[] = $errMsg; $validateRule->{$action}(...$actionArgs); }

Additional context

XueSiLf commented 2 years ago

好的,感谢反馈,今天晚上我处理下。