Checks whether number is of required type. Integers are treated as valid floats.

@return bool
503141
private function validateType(): bool
    {
        switch ($this->options['type']) {
            case 'integer':
                $isValid = \is_int($this->value) ? true : false;
                break;
            case 'float':
                $isValid = \is_int($this->value) || \is_float($this->value) ? true : false;
                break;
            default:
                $isValid = \is_int($this->value) || \is_float($this->value) ? true : false;
                break;
        }
        if (!$isValid) {
            $this->setError(self::VALIDATOR_ERROR_NUMBER_INCORRECT_TYPE);
        }
        return $isValid;
    }
1015499
public function isNumeric() {
        $IsNumeric = false;
        if ($this->type == "integer" || $this->type == "bigint") {
            $IsNumeric = true;
        }
        return $IsNumeric;
    }
935851
def valid? number
      raise_on_type_mismatch number
      num, check = split_number(number)
      self.of(num) == check
    end
162782
public function isValid()
    {
        // these schemes are allowed
        $allowedSchemes = $this->getAllowedSchemes();

        // get the field value
        $url = $this->field->getValue();


        // not required and empty? Then its valid
        if ($this->isNotRequiredAndEmpty($url)) {
            return true;
        }

        if ($this->getMaxLength() && strlen($url) > $this->getMaxLength()) {
            // Over maximum length.
            return false;
        }

        // do simple validation
        if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_SCHEME_REQUIRED)) {
            return false;
        }

        // check if we have a tld
        if (!$this->isSkipTldCheck() && !preg_match('#\.[a-z]{2,}$#', parse_url($url, PHP_URL_HOST))) {
            return false;
        }

        // further validation is required.
        if (in_array(parse_url($url, PHP_URL_SCHEME), $allowedSchemes)) {
            return true;
        }

        return false;
    }
1368232
public function isInteger()
    {
        return $this->data_type === PDO::PARAM_INT ||
            $this->data_type === (PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT);
    }
1326571
public function isInt()
  {
    return (is_numeric($this->string) && !$this->contains(".") && !$this->contains("x")) ? TRUE : FALSE;
  }
377420
public function valid()
    {

        if ($this->container['region'] === null) {
            return false;
        }
        $allowed_values = $this->getRegionAllowableValues();
        if (!in_array($this->container['region'], $allowed_values)) {
            return false;
        }
        if ($this->container['machineType'] === null) {
            return false;
        }
        $allowed_values = $this->getMachineTypeAllowableValues();
        if (!in_array($this->container['machineType'], $allowed_values)) {
            return false;
        }
        if ($this->container['size'] === null) {
            return false;
        }
        if ($this->container['billingType'] === null) {
            return false;
        }
        $allowed_values = $this->getBillingTypeAllowableValues();
        if (!in_array($this->container['billingType'], $allowed_values)) {
            return false;
        }
        if ($this->container['machineName'] === null) {
            return false;
        }
        if ($this->container['templateId'] === null) {
            return false;
        }
        return true;
    }
693138
private function validateTypeNumeric($subject): bool
    {
        // number
        if (($this->schema['type'] === 'number') && !\is_integer($subject) && !\is_float($subject)) {
            return false;
        }
        // integer
        if (($this->schema['type'] === 'integer') && !\is_integer($subject)) {
            return false;
        }
        // float
        if (($this->schema['type'] === 'float') && !\is_float($subject)) {
            return false;
        }
        return true;
    }
534335
private function validateNumber(): bool
    {
        $value = $this->value;
        $length = \strlen($value);
        $sum = 0;
        $weight = 2;

        if ($length < 2) {
            $this->setError(self::VALIDATOR_ERROR_CREDIT_CARD_NUMBER_NOT_VALID);
            return false;
        }

        for ($i = $length - 2; $i >= 0; $i--) {
            $digit = $weight * $value[$i];
            $sum += \floor($digit / 10) + $digit % 10;
            $weight = $weight % 2 + 1;
        }

        if ((10 - $sum % 10) % 10 != $value[$length - 1]) {
            $this->setError(self::VALIDATOR_ERROR_CREDIT_CARD_NUMBER_NOT_VALID);
            return false;
        }
        return true;
    }
982319
public function validate()
    {
        if (is_numeric($this->categoryId) && $this->categoryId >= 1
                && is_numeric($this->forumId) && $this->forumId >= 1
                && is_numeric($this->threadId) && $this->threadId >= 1
                && !empty($this->threadSlug)) {
            return true;
        }
        return false;
    }
336350
def _is_valid_integer(self, inpt, metadata):
        """"""
        if not isinstance(inpt, int):
            return False
        if metadata.get_minimum_integer() and inpt < metadata.get_maximum_integer():
            return False
        if metadata.get_maximum_integer() and inpt > metadata.get_minimum_integer():
            return False
        if metadata.get_integer_set() and inpt not in metadata.get_integer_set():
            return False
        else:
            return True
361012
protected function checkType()
    {
        if (is_scalar($this->format)) {
            return array_key_exists($this->format, $this->patterns);
        } elseif (is_array($this->format)) {
            $pattern = [];
            foreach ($this->format as $f) {
                if (!array_key_exists($f, $this->patterns)) {
                    return false;
                }
                $pattern[] = substr($this->patterns[$f], 2, strlen($this->patterns[$f]) - 4);
            }
            $this->format = 'custom';
            $this->patterns[$this->format] = '/^(' . implode('|', $pattern) . ')$/';

            return true;
        }

        return false;
    }
435498
public function getIsNumeric()
	{
		switch ( $this->TypeCode )
		{
			case XmlTypeCode::Decimal:
			case XmlTypeCode::Float:
			case XmlTypeCode::Double:
			case XmlTypeCode::Integer:
			case XmlTypeCode::NonPositiveInteger:
			case XmlTypeCode::NegativeInteger:
			case XmlTypeCode::Long:
			case XmlTypeCode::Int:
			case XmlTypeCode::Short:
			case XmlTypeCode::Byte:
			case XmlTypeCode::NonNegativeInteger:
			case XmlTypeCode::UnsignedLong:
			case XmlTypeCode::UnsignedInt:
			case XmlTypeCode::UnsignedShort:
			case XmlTypeCode::UnsignedByte:
			case XmlTypeCode::PositiveInteger:
				return true;
		}
		return false;
	}
695958
public function isValid() {
		
		$params = $this -> getParameters();
		$file 	= $this -> getFile();

		if(false === isset($params[0])) {
			return trigger_error(sprintf('Missing argument 1 for %s', __METHOD__), E_USER_ERROR);
		}

		if(false === ('-' . intval($params[0]) == '-' . $params[0])) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($params[0])), E_USER_ERROR);
		}

		$size = @filesize($file['tmp_name']);

		if(true === is_int($size)) {

			if($size >= $params[0]) {
				return true;
			}
		}

		return false;
	}
1259208
public function valid()
    {

        if ($this->container['date'] === null) {
            return false;
        }
        if ($this->container['refId'] === null) {
            return false;
        }
        if ($this->container['refType'] === null) {
            return false;
        }
        $allowedValues = $this->getRefTypeAllowableValues();
        if (!in_array($this->container['refType'], $allowedValues)) {
            return false;
        }
        $allowedValues = $this->getFirstPartyTypeAllowableValues();
        if (!in_array($this->container['firstPartyType'], $allowedValues)) {
            return false;
        }
        $allowedValues = $this->getSecondPartyTypeAllowableValues();
        if (!in_array($this->container['secondPartyType'], $allowedValues)) {
            return false;
        }
        return true;
    }
357302
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        $match = preg_match($this->regex, $value);

        return $this->not ? !$match : $match;
    }
530968
public function isValid()
    {
        // Names must not be empty, but can be 0
        $name = $this->name();
        if (empty($name) && !is_numeric($name)) {
            return 'The cookie name must not be empty';
        }
        // Check if any of the invalid characters are present in the cookie name
        if (preg_match('/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/', $name)) {
            return 'Cookie name must not contain invalid characters: ASCII Control characters (0-31;127), space, tab and the following characters: ()<>@,;:\"/?={}';
        }
        // Value must not be empty, but can be 0
        $value = $this->value();
        if (empty($value) && !is_numeric($value)) {
            return 'The cookie value must not be empty';
        }
        // Domains must not be empty, but can be 0
        // A "0" is not a valid internet domain, but may be used as server name
        // in a private network.
        $domain = $this->domain();
        if (empty($domain) && !is_numeric($domain)) {
            return 'The cookie domain must not be empty';
        }
        return true;
    }