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
Ejemplo n.º 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));
 }
Ejemplo n.º 2
0
Archivo: Cache.php Proyecto: jbzoo/less
 /**
  * @param int $newTTL In seconds (1 to 365 days)
  */
 public function setCacheTTL($newTTL)
 {
     $newTTL = Filter::int($newTTL);
     $newTTL = Vars::limit($newTTL, 1, 86400 * 365);
     $this->_cache_ttl = $newTTL;
 }