digit() публичный статический Метод

Validates if an integer or integerish is a digit.
public static digit ( mixed $value, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$message string | null
$propertyPath string | null
Результат boolean
Пример #1
0
 public function testValidDigit()
 {
     Assertion::digit(1);
     Assertion::digit(0);
     Assertion::digit("0");
 }
Пример #2
0
 /**
  * Validate price:
  * 0 < $price < 10000
  * @param $price
  */
 public static function price($price)
 {
     Assert::digit($price);
     Assert::greaterThan($price, 0);
     Assert::lessThan($price, 10000);
 }