public static function clamp(int $value, int $min, int $max)
    {
        return $value < $min ? $min : ($value > $max ? $max : $value);
    }
public static function clamp(int $value, int $min, int $max)
    {
        return $value < $min ? $min : ($value > $max ? $max : $value);
    }
public static function clamp ( int $ value , int $ min , int $ max ) { return $ value < $ min ? $ min : ( $ value > $ max ? $ max : $ value ) ; }
Restrict the value to a specific valid range.

@param int $value The value to clamp
@param int $min THe minimum allowable value
@param int $max The maximum allowable value
@return int The value, $min when $value is less than $min, or $max when $value is more than max.
Restrict the value to a specific valid range .