From eb120588609cbe9848239fcd904532d0a0ed2f48 Mon Sep 17 00:00:00 2001 From: cguroo Date: Wed, 19 Nov 2014 12:09:20 +0530 Subject: [PATCH] Update Validator.php Hi, I have added a strict flag as an argument since anyone who wishes a strict comparison shall have the option, and btw in_array without strict is sort of "useless" in most cases, IMHO. heres why i say so. http://php.net/manual/en/function.in-array.php#106319 --- src/Valitron/Validator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Valitron/Validator.php b/src/Valitron/Validator.php index 08b6e58..d68007a 100644 --- a/src/Valitron/Validator.php +++ b/src/Valitron/Validator.php @@ -350,14 +350,14 @@ class Validator * @internal param array $fields * @return bool */ - protected function validateIn($field, $value, $params) + protected function validateIn($field, $value, $params, $strict = false) { $isAssoc = array_values($params[0]) !== $params[0]; if ($isAssoc) { $params[0] = array_keys($params[0]); } - return in_array($value, $params[0]); + return in_array($value, $params[0], $strict); } /**