From 5a10a4fe96bc03275208eaf63c026cf40e8eb1de Mon Sep 17 00:00:00 2001 From: Kilte Date: Tue, 7 Jan 2014 04:34:38 +0400 Subject: [PATCH] Fixed hasRule() method. --- src/Valitron/Validator.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index b8c4428..6632a7c 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -589,10 +589,13 @@ class Validator */ protected function hasRule($name, $field) { - foreach($this->_validations as $validation) { - if ($validation['rule'] == $name) - return in_array($field, $validation['fields']); - } + foreach($this->_validations as $validation) { + if ($validation['rule'] == $name) { + if (in_array($field, $validation['fields'])) { + return true; + } + } + } return false; }