JBZoo\Utils\Vars::limit PHP Method

limit() public static method

Limits the number between two bounds.
public static limit ( integer $number, integer $min, integer $max ) : integer
$number integer
$min integer
$max integer
return integer
    public static function limit($number, $min, $max)
    {
        return self::max(self::min($number, $min), $max);
    }

Usage Example

Beispiel #1
0
 public function testLimit()
 {
     is(100, Vars::limit(125, 50, 100));
     is(50, Vars::limit(45, 50, 100));
     is(77, Vars::limit(77, 50, 100));
 }
All Usage Examples Of JBZoo\Utils\Vars::limit