limit() 공개 정적인 메소드

Limits the number between two bounds.
public static limit ( integer $number, integer $min, integer $max ) : integer
$number integer
$min integer
$max integer
리턴 integer
예제 #1
0
파일: VarsTest.php 프로젝트: jbzoo/utils
 public function testLimit()
 {
     is(100, Vars::limit(125, 50, 100));
     is(50, Vars::limit(45, 50, 100));
     is(77, Vars::limit(77, 50, 100));
 }
예제 #2
0
파일: Cache.php 프로젝트: 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;
 }