diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index 60b1603..518b8bc 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -1507,7 +1507,7 @@ public function rules($rules) $innerParams = (array)$innerParams; } array_unshift($innerParams, $ruleType); - call_user_func_array(array($this, 'rule'), $innerParams); + call_user_func_array(array($this, 'rule'), array_values($innerParams)); } } else { $this->rule($ruleType, $params); @@ -1555,7 +1555,7 @@ public function mapFieldRules($field, $rules) unset($rule['message']); } //Add the field and additional parameters to the rule - $added = call_user_func_array(array($me, 'rule'), array_merge(array($ruleName, $field), $rule)); + $added = call_user_func_array(array($me, 'rule'), array_values(array_merge(array($ruleName, $field), $rule))); if (!empty($message)) { $added->message($message); }