改名
This commit is contained in:
+7
-6
@@ -186,13 +186,14 @@ class Validator extends BaseValidator
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
foreach ($this->validators as $val) {
|
foreach ($this->validators as $val) {
|
||||||
if ($this->check($val)) {
|
[$result, $validator] = $this->check($val);
|
||||||
|
if ($result === true) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$isTrue = false;
|
$isTrue = false;
|
||||||
if ($val instanceof BaseValidator) {
|
if ($validator instanceof BaseValidator) {
|
||||||
var_dump($val->getError());
|
var_dump($validator->getError());
|
||||||
$this->addError($val->getError());
|
$this->addError($validator->getError());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -209,7 +210,7 @@ class Validator extends BaseValidator
|
|||||||
private function check(BaseValidator|array|Closure $val): mixed
|
private function check(BaseValidator|array|Closure $val): mixed
|
||||||
{
|
{
|
||||||
if (is_callable($val, true)) {
|
if (is_callable($val, true)) {
|
||||||
return call_user_func($val, $this);
|
return [call_user_func($val, $this), $val];
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = Kiri::getDi()->get($val['class']);
|
$class = Kiri::getDi()->get($val['class']);
|
||||||
@@ -217,7 +218,7 @@ class Validator extends BaseValidator
|
|||||||
|
|
||||||
Kiri::configure($class, $val);
|
Kiri::configure($class, $val);
|
||||||
|
|
||||||
return $class->trigger();
|
return [$class->trigger(), $class];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user