Validators
class Validators
Validation utilities.
Properties
static protected | $validators | ||
static protected | $counters |
Methods
Throws exception if a variable is of unexpected type.
Throws exception if an array field is missing or of unexpected type.
Finds whether a variable is of expected type.
Finds whether all values are of expected type.
Finds whether a value is an integer or a float.
Finds whether a value is an integer.
Finds whether a string is a floating point number in decimal base.
Finds whether a value is a syntactically correct callback.
Finds whether a value is an UTF-8 encoded string.
Finds whether a value is "falsy".
Finds whether a variable is a zero-based integer indexed array.
Is a value in specified range?
Finds whether a string is a valid email address.
Finds whether a string is a valid http(s) URL.
Finds whether a string is a valid URI according to RFC 1738.
Checks whether the input is a class, interface or trait.
Checks whether the input is a valid PHP identifier.
Details
at line 77
static void
assert($value, $expected, $label = 'variable')
Throws exception if a variable is of unexpected type.
at line 103
static void
assertField($arr, $field, $expected = null, $label = "item '%' in array")
Throws exception if an array field is missing or of unexpected type.
at line 121
static bool
is($value, $expected)
Finds whether a variable is of expected type.
at line 170
static bool
everyIs($values, $expected)
Finds whether all values are of expected type.
at line 188
static bool
isNumber($value)
Finds whether a value is an integer or a float.
at line 198
static bool
isNumericInt($value)
Finds whether a value is an integer.
at line 208
static bool
isNumeric($value)
Finds whether a string is a floating point number in decimal base.
at line 218
static bool
isCallable($value)
Finds whether a value is a syntactically correct callback.
at line 229
static bool
isUnicode($value)
Finds whether a value is an UTF-8 encoded string.
at line 239
static bool
isNone($value)
Finds whether a value is "falsy".
at line 250
static bool
isList($value)
Finds whether a variable is a zero-based integer indexed array.
at line 262
static bool
isInRange($value, $range)
Is a value in specified range?
at line 288
static bool
isEmail($value)
Finds whether a string is a valid email address.
at line 306
static bool
isUrl($value)
Finds whether a string is a valid http(s) URL.
at line 327
static bool
isUri($value)
Finds whether a string is a valid URI according to RFC 1738.
at line 338
static bool
isType($type)
Checks whether the input is a class, interface or trait.
at line 348
static bool
isPhpIdentifier($value)
Checks whether the input is a valid PHP identifier.
Traits
Static class.