/** * */ public function testIsIp() { $input = '192.168.1.1'; $this->assertTrue(Inspekt::isIp($input)); }
/** * 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; }
/** * 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; }