Skip to content

Commit d746591

Browse files
author
lphkxd
committed
支持3.1
1 parent ac56064 commit d746591

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"description": "hyperf-plus validate 支持request 和方法场景验证,兼容tp5写法 支持控制器注解验证、方法注解验证",
1111
"license": "Apache-2.0",
1212
"require": {
13-
"php": ">=8.0",
14-
"hyperf/di": "^3.0.0",
15-
"hyperf/http-message": "^3.0.0",
16-
"hyperf/utils": "^3.0.0"
13+
"php": ">=8.1",
14+
"hyperf/di": "^3.1.0",
15+
"hyperf/http-message": "^3.1.0",
16+
"hyperf/utils": "^3.1.0"
1717
},
1818
"suggest": {
1919
"ext-json": "Required to use JSON."

src/Aspect/ValidationAspect.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class ValidationAspect extends AbstractAspect
2323

2424
protected $request;
2525
// 要切入的类,可以多个,亦可通过 :: 标识到具体的某个方法,通过 * 可以模糊匹配
26-
// 要切入的类,可以多个,亦可通过 :: 标识到具体的某个方法,通过 * 可以模糊匹配
2726
public array $annotations = [Validation::class, RequestValidation::class];
2827

2928
public function __construct(ContainerInterface $container, ServerRequestInterface $Request)
@@ -69,7 +68,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint)
6968
private function validationData($validation, $verData, $class, $proceedingJoinPoint, $isRequest = false)
7069
{
7170
/**
72-
* @var RequestValidation $validation
71+
* @var Validation $validation
7372
*/
7473
/**
7574
* @var Validate $validate
@@ -89,7 +88,7 @@ private function validationData($validation, $verData, $class, $proceedingJoinPo
8988
$rules = $validate->getSceneRule($validation->scene);
9089
}
9190
if ($validate->batch($validation->batch)->check($verData, $rules, $validation->scene) === false) {
92-
throw new ValidateException($validate->getError());
91+
throw new ValidateException((string)$validate->getError());
9392
}
9493
if ($validation->security) {
9594
$fields = $this->getFields($rules);

src/Validate.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use SplFileInfo;
66
use SplFileObject;
77
use Hyperf\DbConnection\Db;
8-
use Hyperf\Utils\Str;
98

109
class Validate
1110
{

0 commit comments

Comments
 (0)