/**
  * 
  */
 public function testIsIp()
 {
     $input = '192.168.1.1';
     $this->assertTrue(Inspekt::isIp($input));
 }
Exemple #2
0
 /**
  * Returns value if it is a valid IP format, FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  *
  * @tag validator
  */
 function testIp($key)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Inspekt::isIp($this->_getValue($key))) {
         return $this->_getValue($key);
     }
     return FALSE;
 }
Exemple #3
0
 /**
  * Returns value if it is a valid IP format, FALSE otherwise.
  *
  * @param mixed $key
  * @return mixed
  * @throws Exception
  * @tag validator
  */
 public function testIp($key)
 {
     $value = $this->getValueOrNull($key);
     if (!is_null($value) && Inspekt::isIp($value)) {
         return $value;
     }
     return false;
 }