forked from devsam/core
refac: Util::valueFit을 Util::clamp로
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user