From 3a4172d593340d958942a8f8590d2ab205fdf282 Mon Sep 17 00:00:00 2001 From: nguyenanhung Date: Fri, 10 Mar 2023 09:39:09 +0700 Subject: [PATCH] Refactor Validator --- src/BaseHelper.php | 2 +- src/Validator.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/BaseHelper.php b/src/BaseHelper.php index c0f99cf..04bbd58 100644 --- a/src/BaseHelper.php +++ b/src/BaseHelper.php @@ -19,7 +19,7 @@ */ class BaseHelper { - const VERSION = '1.3.1'; + const VERSION = '1.3.2'; const LAST_MODIFIED = '2023-03-10'; const PROJECT_NAME = 'CodeIgniter - Basic Helper'; const AUTHOR_NAME = 'Hung Nguyen'; diff --git a/src/Validator.php b/src/Validator.php index 62db8c1..1e2ab10 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -1043,8 +1043,7 @@ protected function validateRequiredWith($field, $value, $params, $fields) } } // if we have conditionally required fields - if ($conditionallyReq && (is_null($value) || - is_string($value) && trim($value) === '')) { + if ($conditionallyReq && (is_null($value) || (is_string($value) && trim($value) === ''))) { return false; } @@ -1089,8 +1088,7 @@ protected function validateRequiredWithout($field, $value, $params, $fields) } } // if we have conditionally required fields - if ($conditionallyReq && (is_null($value) || - is_string($value) && trim($value) === '')) { + if ($conditionallyReq && (is_null($value) || (is_string($value) && trim($value) === ''))) { return false; }