diff --git a/src/Validator/BindForm.php b/src/Validator/BindForm.php index 99a7564..d0b72fc 100644 --- a/src/Validator/BindForm.php +++ b/src/Validator/BindForm.php @@ -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]]); } diff --git a/src/Validator/Binding.php b/src/Validator/Binding.php index 08497f9..a1533c4 100644 --- a/src/Validator/Binding.php +++ b/src/Validator/Binding.php @@ -89,7 +89,11 @@ class Binding implements RequestFilterInterface */ protected function getValidator($key, $rule): array { - $class = array_merge(self::TYPES[$key], ['value' => $rule, 'field' => $key]); + 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;