Check if value is digit (ctype_digit)

@return $this
@throws InvalidDigitException
@throws InvalidStringException
541582
public function digit()
    {
        if (!is_string($this->value)) {
            throw new InvalidStringException($this->name, $this->value);
        } elseif (!ctype_digit($this->value)) {
            throw new InvalidDigitException($this->name, $this->value);
        }

        return $this;
    }
771064
public function isInteger()
    {
        if (is_null($this->integer)) {
            $this->integer = $this->isRuleExists('integer');
        }

        return $this->integer;
    }
301744
protected function validateNumericCodeCurrency()
    {
        $field = 'numeric_code';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Numeric code');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        if (preg_match('/^[0-9]{3}$/', $value) !== 1) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        $updating = $this->getUpdating();

        if (isset($updating['numeric_code']) && $updating['numeric_code'] == $value) {
            return true;
        }

        foreach ($this->currency->getList() as $currency) {
            if ($currency['numeric_code'] == $value) {
                $this->setErrorExists($field, $label);
                return false;
            }
        }

        return true;
    }
690104
public static function ctype_digit($text)
    {
        $text = self::convert_int_to_char_for_ctype($text);

        return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
    }
452626
function(digit) {
			if(typeof digit === "undefined") {
				digit = this.digit;
			}
			else {
				this.digit = digit;
			}

			if(this.digit != this.lastDigit) {
				var $delete = this.$el.find('.'+this.classes.before).removeClass(this.classes.before);

				this.$el.find('.'+this.classes.active).removeClass(this.classes.active)
													  .addClass(this.classes.before);

				this.appendListItem(this.classes.active, this.digit);

				$delete.remove();

				this.lastDigit = this.digit;
			}	
		}
391200
public function digits($msg)
    {
        if(strlen($this->_value) > 0 && !ctype_digit((string) $this->_value)) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
283582
public function numeric()
    {
        if (!is_int($this->value) && !is_float($this->value) && !is_string($this->value)) {
            throw new InvalidIntOrFloatOrStringException($this->name, $this->value);
        } elseif (!is_numeric($this->value)) {
            throw new InvalidNumericException($this->name, $this->value);
        }

        return $this;
    }
584973
def validate_digit(value, start, end):
    ''''''
    if not str(value).isdigit() or int(value) < start or int(value) > end:
        raise ValueError('%s must be a digit from %s to %s' % (value, start, end))
1040425
static public function digit($value, $message = null, $propertyPath = null)
        {
            if ( ! ctype_digit((string)$value)) {
                $message = $message ?: sprintf(
                    'Value "%s" is not a digit.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::INVALID_DIGIT, $propertyPath);
            }
        }
907280
public function isValueValid($value)
    {
        // If this value is a string and is mostly a number...
        if (is_string($value) && is_numeric($value))
        {
            // ...but contains an exponential value.
            if (0 <= strpos($value, 'e'))
            {
                // TODO: throw exception, maybe??
                trigger_error('FHIRDecimal should NOT contain exponential value.  "'.$value.'" seen.');
                return true;
            }
            // ...and does not contain a decimal.
            else if (false === strpos($value, '.'))
            {
                return ctype_digit($value);
            }
            // ...Assume we're OK for now...
            // TODO: Additional checks
            else
            {
                return true;
            }
        }
        else if (is_int($value) || is_float($value))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
479368
public function negative()
    {
        if (!is_int($this->value) && !is_float($this->value)) {
            throw new InvalidIntOrFloatException($this->name, $this->value);
        } elseif ($this->value >= 0) {
            throw new NumberNotNegativeException($this->name, $this->value);
        }

        return $this;
    }
364543
def digit():
    ''''''
    @Parser
    def digit_parser(text, index=0):
        if index < len(text) and text[index].isdigit():
            return Value.success(index + 1, text[index])
        else:
            return Value.failure(index, 'a digit')
    return digit_parser
72415
protected function checkValue(): void
    {
        if (!ctype_digit($this->value) && !is_numeric($this->value) && !empty($this->value)) {
            throw new InvalidArgumentException('NumericParser: Value must be of type numeric');
        }
    }
563191
public function isChsAlphaNum() {
        $this->check_role = 'chsAlphaNum';
        $result = $this->checkRegex($this->value, '/^[\x{4e00}-\x{9fa5}a-zA-Z0-9]+$/u');
        $this->checkResult($result);
        return $this;
    }
8139
public static function numericId ($value)
    {
        // Check type and characters
        if (!is_int($value)
            &&
            !(is_string($value) && preg_match('/^[0-9]+$/', $value))
        ) {
            return false;
        }

        // Check range
        if ($value > 0) {
            return false;
        }

        // Valid
        return true;
    }
326545
public function isAlphaNum() {
        $this->check_role = 'alphaNum';
        $result = $this->checkRegex($this->value, '/^[A-Za-z0-9]+$/');
        $this->checkResult($result);
        return $this;
    }
1101421
public function asNumericString(): Primitive\NumericString
    {
        if (!$this->_element instanceof Primitive\NumericString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_NUMERIC_STRING));
        }
        return $this->_element;
    }