From 7b5c0523a49d18af4b422cf54e6a3da275beaf13 Mon Sep 17 00:00:00 2001 From: esyede Date: Fri, 24 Nov 2023 00:33:06 +0700 Subject: [PATCH] small changes --- system/carbon.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/carbon.php b/system/carbon.php index 4e1a6ccc..0ac60179 100644 --- a/system/carbon.php +++ b/system/carbon.php @@ -471,7 +471,7 @@ public function toW3cString() public function eq(Carbon $dt) { - $this->validate($dt); + $this->checkComparator($dt); return $this == $dt; // '==' memang disengaja } @@ -482,25 +482,25 @@ public function ne(Carbon $dt) public function gt(Carbon $dt) { - $this->validate($dt); + $this->checkComparator($dt); return $this > $dt; } public function gte(Carbon $dt) { - $this->validate($dt); + $this->checkComparator($dt); return $this >= $dt; } public function lt(Carbon $dt) { - $this->validate($dt); + $this->checkComparator($dt); return $this < $dt; } public function lte(Carbon $dt) { - $this->validate($dt); + $this->checkComparator($dt); return $this <= $dt; } @@ -1028,7 +1028,7 @@ public function isBirthday(Carbon $dt) return $this->format('md') === $dt->format('md'); } - private function validate($dt) + private function checkComparator($dt) { if ($dt === null || is_bool($dt)) { throw new \Exception('Cannot compare with null or boolean value');