From e7918469e5d9e852b18bc9ee88f3b92ce5f8b593 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 4 Jul 2022 23:25:44 +0900 Subject: [PATCH] =?UTF-8?q?refac:=20Util::valueFit=EC=9D=84=20Util::clamp?= =?UTF-8?q?=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sammo/Util.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sammo/Util.php b/src/sammo/Util.php index e4ec5287..b0b9a61f 100644 --- a/src/sammo/Util.php +++ b/src/sammo/Util.php @@ -486,6 +486,14 @@ class Util extends \utilphp\util * $min과 $max 사이의 값으로 교정 */ public static function valueFit($value, $min = null, $max = null) + { + return static::clamp($value, $min, $max); + } + + /** + * $min과 $max 사이의 값으로 교정 + */ + public static function clamp($value, $min = null, $max = null) { if($max !== null && $min !== null && $max < $min){ return $min;