/**
  * Generated from @assert ('p', 'a', 'm', FALSE) === FALSE.
  */
 public function testIsBetween4()
 {
     $this->assertSame(FALSE, Inspekt::isBetween('p', 'a', 'm', FALSE));
 }
Exemple #2
0
 /**
  * Returns value if it is greater than or equal to $min and less
  * than or equal to $max, FALSE otherwise. If $inc is set to
  * FALSE, then the value must be strictly greater than $min and
  * strictly less than $max.
  *
  * @param mixed $key
  * @param mixed $min
  * @param mixed $max
  * @param boolean $inc
  * @return mixed
  *
  * @tag validator
  */
 function testBetween($key, $min, $max, $inc = TRUE)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Inspekt::isBetween($this->_getValue($key), $min, $max, $inc)) {
         return $this->_getValue($key);
     }
     return FALSE;
 }
Exemple #3
0
 /**
  * Returns value if it is greater than or equal to $min and less
  * than or equal to $max, FALSE otherwise. If $inc is set to
  * FALSE, then the value must be strictly greater than $min and
  * strictly less than $max.
  *
  * @param mixed $key
  * @param mixed $min
  * @param mixed $max
  * @param boolean $inc
  * @return mixed
  * @throws Exception
  * @tag validator
  */
 public function testBetween($key, $min, $max, $inc = true)
 {
     $value = $this->getValueOrNull($key);
     if (!is_null($value) && Inspekt::isBetween($value, $min, $max, $inc)) {
         return $value;
     }
     return false;
 }