From 77dcdeccb4bc9cf8ffc9c24cf08c3643a491afd3 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" <51850998+paulbalandan@users.noreply.github.com> Date: Sun, 31 Oct 2021 19:08:31 +0800 Subject: [PATCH] Apply suggestions from code review --- system/Database/BaseBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index 5ea08811e110..83b74035f848 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -659,7 +659,7 @@ protected function whereHaving(string $qbKey, $key, $value = null, string $type $op = trim(current($op)); if (substr($k, -1 * strlen($op)) === $op) { - $k = rtrim(substr($k, 0, -1 * strlen($op))); + $k = rtrim(substr($k, 0, -strlen($op))); $op = " {$op}"; } else { $op = ''; @@ -680,7 +680,7 @@ protected function whereHaving(string $qbKey, $key, $value = null, string $type $op = ' IS NULL'; } elseif (preg_match('/\s*(!?=|<>|IS(?:\s+NOT)?)\s*$/i', $k, $match, PREG_OFFSET_CAPTURE)) { $k = substr($k, 0, $match[0][1]); - $op = ($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL'); + $op = $match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL'; } else { $op = ''; }