@param int $value

@return bool
160240
private function doCheckPrime($value)
    {
        if (2 > $value) {
            return false;
        }

        if (2 == $value) {
            return true;
        }

        for ($i = 2; $i * $i <= $value; ++$i) {
            if (0 === $value % $i) {
                return false;
            }
        }

        return true;
    }
7394
protected function isValueSelected($value)
	{
		$val = $this->getValue();
		if (is_null($value)) {
			return FALSE;
		}
		elseif (is_array($val)) {
			return in_array($value, $val);
		}

		return $value == $val;
	}
634572
private function checkValueTime(int $value)
    {
        if ($value > -1 && $value < 60) {
            if (!isset($this->data['h']) && $value < 24) {
                return "h";
            } elseif (!isset($this->data['i'])) {
                return "i";
            } else {
                return "s";
            }
        }

        return null;
    }
142546
public static function isValid($value)
    {
        if (is_string($value)) {
            $value = [ $value ];
        }
        
        if (!is_array($value) || count($value) === 0) {
            return false;
        }

        foreach ($value as $ep) {
            if (!is_string($ep)) {
                return false;
            }
            $type = self::getType($ep);

            if ($type === null) {
                return false;
            }
        }
        return true;
    }
286305
public function accept(int $type, $value = null) : bool
    {
        if ($this->getCurrentToken()->getType() === $type) {
            if ($value) {
                if ($this->getCurrentToken()->getValue() === $value) {
                    return true;
                }

                return false;
            }

            return true;
        }

        return false;
    }
1058883
private function check($value) {

		if(true === is_string($value) || is_numeric($value)) {

			if(true === $this -> strict) {
				return true === is_int($value);
			}

			return !in_array(preg_match('/^-?[0-9]+$/', $value), [false, 0]);
		}

		return false;
	}
122362
public static function int($value): int
    {
        $cleaned = preg_replace('#[^0-9-+.,]#', '', $value);
        preg_match('#[-+]?[\d]+#', $cleaned, $matches);
        $result = $matches[0] ?? 0;

        return (int)$result;
    }
1354837
public function checkSelectedValue($value)
  {
    if (is_null($this->selected)) {
      return false;
    }

    if (is_array($this->selected)) {
      return in_array($value, $this->selected);
    }

    return $this->selected == $value;
  }
306569
public static function isInt($value): bool
    {
        return ((string)(int)$value === (string)$value || $value === false);
    }
464012
public function isValid($value)
    {
        if (!is_string($value) && !is_int($value) && !is_float($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        if (is_int($value)) {
            return true;
        }

        $this->_setValue($value);
        if ($this->_locale === null) {
            $locale        = localeconv();
            $valueFiltered = str_replace($locale['decimal_point'], '.', $value);
            $valueFiltered = str_replace($locale['thousands_sep'], '', $valueFiltered);

            if (strval(intval($valueFiltered)) != $valueFiltered) {
                $this->_error(self::NOT_INT);
                return false;
            }

        } else {
            try {
                if (!Zend_Locale_Format::isInteger($value, array('locale' => $this->_locale))) {
                    $this->_error(self::NOT_INT);
                    return false;
                }
            } catch (Zend_Locale_Exception $e) {
                $this->_error(self::NOT_INT);
                return false;
            }
        }

        return true;
    }
11936
public function isValid($value)
    {
        $this->_setValue($value);

        if (!is_numeric($value)) {
            return false;
        }

        $value = (float)$value;
        return $value >= 0 && $value <= 1;
    }
718177
public function validate($value)
    {
        return is_int($value) ? Ok::unit() : Error::unit([ Error::NON_INT ]);
    }
711071
public function validate($value)
    {
        if (!is_numeric($value)) {
            return false;
        }

        return $value / $this->number == round($value / $this->number);
    }
294941
protected function getBoolFromStringInt($value)
    {
        if (!($value == '0' || $value == '1')) {
            $this->throwException(sprintf('Expected "0" or "1" but got: %s', $value));
        }

        return (bool) $value;
    }
298000
public function isValid($value)
    {
        $value = (string) $value;
        if (strlen($value) !== 10) {
            $this->_error(self::INVALID_NIP, $value);
            return false;
        }

        $intSum = 0;

        for ($i = 0; $i < 9; $i++) {
            $intSum += $this->_weights[$i] * $value[$i];
        }

        $int = $intSum % 11;
        $intControlNr = ($int === 10) ? 0 : $int;

        if ($intControlNr !== (int) $value[9]) {
            $this->_error(self::INVALID_NIP, $value);
            return false;
        }

        return true;
    }
416548
public static function isInteger($value)
    {
        if (!is_scalar($value) || is_float($value)) {
            return false;
        }
        if (is_int($value)) {
            return true;
        }

        return (bool)preg_match('/^-?[0-9]+$/', $value);
    }
257927
private function convertInt($value)
    {
        if (!is_numeric($value)) {
            return $value;
        }

        if ((string) (int) $value !== (string) $value) {
            return $value;
        }

        return (int) $value;
    }