diff --git a/src/Validator/Binding.php b/src/Validator/Binding.php index e8e4a3d..d58ba71 100644 --- a/src/Validator/Binding.php +++ b/src/Validator/Binding.php @@ -64,6 +64,9 @@ class Binding implements RequestFilterInterface { // TODO: Implement dispatch() method. $array = []; + if (count($this->rules) < 1) { + return $array; + } foreach ($this->rules as $key => $rule) { if (is_string($key)) { $array[] = $this->getValidator($key, $rule); @@ -91,7 +94,7 @@ class Binding implements RequestFilterInterface if (is_numeric($key)) { $class = self::TYPES[$rule]; } else { - $class = array_merge(self::TYPES[$key], ['value' => $rule, 'field' => $key]); + $class = array_merge(self::TYPES[$key], ['value' => $rule, 'field' => $key]); } $isFirst = false; if ($class['class'] === RequiredValidatorFilter::class) {