This commit is contained in:
2023-12-18 02:09:27 +08:00
parent a5b5e10e5e
commit cbeb3698c6
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ class BindForm implements InjectParameterInterface
$validator->setAlias($property->getName(), $rule->field);
}
$validator->addRule($property->getName(), [$this->_typeValidator($property), 'dispatch', false]);
$validator->addRule($property->getName(), [[$this->_typeValidator($property), 'dispatch', false]]);
}
+4
View File
@@ -89,7 +89,11 @@ class Binding implements RequestFilterInterface
*/
protected function getValidator($key, $rule): array
{
if (is_numeric($key)) {
$class = self::TYPES[$key];
} else {
$class = array_merge(self::TYPES[$key], ['value' => $rule, 'field' => $key]);
}
$isFirst = false;
if ($class['class'] === RequiredValidatorFilter::class) {
$isFirst = true;