From 67ff141afeebf74201bcfb73d8e410f3e8f66cb4 Mon Sep 17 00:00:00 2001 From: whwyy Date: Mon, 15 Apr 2024 15:15:08 +0800 Subject: [PATCH] eee --- src/Validator/Binding.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {